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>; }
Expand description

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.

Required methods

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

Encodes a frame into the buffer provided.

Implementations on Foreign Types

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

type Item = <T as Encoder>::Item

type Error = <T as Encoder>::Error

pub fn encode(
    &self,
    item: <Rc<T> as Encoder>::Item,
    dst: &mut BytesMut
) -> Result<(), <Rc<T> as Encoder>::Error>
[src]

Implementors

impl Encoder for ClientCodec[src]

type Item = Message<(RequestHeadType, BodySize)>

type Error = Error

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

impl Encoder for ntex::http::h1::Codec[src]

type Item = Message<(Response<()>, BodySize)>

type Error = Error

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

impl Encoder for ntex::ws::Codec[src]

type Item = Message

type Error = ProtocolError

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

impl Encoder for BytesCodec[src]

type Item = Bytes

type Error = Error

pub fn encode(
    &self,
    item: Bytes,
    dst: &mut BytesMut
) -> Result<(), <BytesCodec as Encoder>::Error>
[src]