[][src]Trait ntex_codec::Encoder

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

Trait of helper objects to write out messages as bytes.

Associated Types

type Item

The type of items consumed by the Encoder

type Error

The type of encoding errors.

Loading content...

Required methods

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

Encodes a frame into the buffer provided.

Loading content...

Implementors

impl Encoder for BytesCodec[src]

type Item = Bytes

type Error = Error

Loading content...