Trait ntex_codec::Encoder[][src]

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

Trait of helper objects to write out messages as bytes.

Associated Types

type Item[src]

The type of items consumed by the Encoder

type Error: Debug[src]

The type of encoding errors.

Loading content...

Required methods

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

Encodes a frame into the buffer provided.

Loading content...

Implementations on Foreign Types

impl<T> Encoder for Rc<T> where
    T: Encoder
[src]

type Item = T::Item

type Error = T::Error

Loading content...

Implementors

impl Encoder for BytesCodec[src]

type Item = Bytes

type Error = Error

Loading content...