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

    fn encode(
        &mut self,
        item: Self::Item,
        dst: &mut BytesMut
    ) -> Result<(), Self::Error>; }
Expand description

Encoding of messages as bytes, for use with FramedWrite.

Required Associated Types§

The type of items consumed by encode

The type of encoding errors.

Required Methods§

Encodes an item into the BytesMut provided by dst.

Implementors§