pub trait Encoder {
    type Item;
    type Error: Debug;
    fn encode(
        &self,
        item: Self::Item,
        dst: &mut BytesMut
    ) -> Result<(), Self::Error>; fn encode_vec(
        &self,
        item: Self::Item,
        dst: &mut BytesVec
    ) -> Result<(), Self::Error> { ... } }
Expand description

Trait of helper objects to write out messages as bytes.

Associated Types

The type of items consumed by the Encoder

The type of encoding errors.

Required methods

Encodes a frame into the buffer provided.

Provided methods

Encodes a frame into the buffer provided.

Implementations on Foreign Types

Implementors