pub trait Decoder {
    type Item;
    type Error: From<Error>;

    fn decode(
        &mut self,
        src: &mut BytesMut
    ) -> Result<Option<Self::Item>, Self::Error>; fn decode_eof(
        &mut self,
        src: &mut BytesMut
    ) -> Result<Option<Self::Item>, Self::Error> { ... } }
Expand description

Decoding of frames via buffers, for use with FramedRead.

Required Associated Types§

The type of items returned by decode

The type of decoding errors.

Required Methods§

Decode an item from the src BytesMut into an item

Provided Methods§

Called when the input stream reaches EOF, signaling a last attempt to decode

Notes

The default implementation of this method invokes the Decoder::decode method.

Implementors§