pub trait Decoder {
    type Item;
    type Error: Debug;
    fn decode(
        &self,
        src: &mut BytesMut
    ) -> Result<Option<Self::Item>, Self::Error>; fn decode_vec(
        &self,
        src: &mut BytesVec
    ) -> Result<Option<Self::Item>, Self::Error> { ... } }
Expand description

Decoding of frames via buffers.

Associated Types

The type of decoded frames.

The type of unrecoverable frame decoding errors.

If an individual message is ill-formed but can be ignored without interfering with the processing of future messages, it may be more useful to report the failure as an Item.

Required methods

Attempts to decode a frame from the provided buffer of bytes.

Provided methods

Attempts to decode a frame from the provided buffer of bytes.

Implementations on Foreign Types

Implementors