Struct framecodecs::length_field::LengthFieldCodec
[−]
[src]
pub struct LengthFieldCodec<B> { /* fields omitted */ }
Protocol codec used by LengthFieldProto
.
Methods
impl<B> LengthFieldCodec<B>
[src]
fn new(field_size: usize) -> LengthFieldCodec<B>
Trait Implementations
impl<B: Debug> Debug for LengthFieldCodec<B>
[src]
impl<B: Clone> Clone for LengthFieldCodec<B>
[src]
fn clone(&self) -> LengthFieldCodec<B>
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<B: ByteOrder> Codec for LengthFieldCodec<B>
[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