Struct framecodecs::fixed_length::FixedLengthCodec
[−]
[src]
pub struct FixedLengthCodec { /* fields omitted */ }
Protocol codec used by FixedLengthProto
.
Methods
impl FixedLengthCodec
[src]
fn new(length: usize) -> FixedLengthCodec
fn length(&self) -> usize
Trait Implementations
impl Debug for FixedLengthCodec
[src]
impl Clone for FixedLengthCodec
[src]
fn clone(&self) -> FixedLengthCodec
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Codec for FixedLengthCodec
[src]
type In = Vec<u8>
The type of decoded frames.
type Out = Vec<u8>
The type of frames to be encoded.
fn decode(&mut self, buf: &mut EasyBuf) -> Result<Option<Vec<u8>>>
Attempts to decode a frame from the provided buffer of bytes. Read more
fn encode(&mut self, item: Vec<u8>, buf: &mut Vec<u8>) -> Result<()>
Encodes a frame into the buffer provided. Read more
fn decode_eof(&mut self, buf: &mut EasyBuf) -> Result<Self::In, Error>
A default method available to be called when there are no more bytes available to be read from the underlying I/O. Read more