Trait asynchronous_codec::Encoder [−][src]
pub trait Encoder {
type Item;
type Error: From<Error>;
fn encode(
&mut self,
item: Self::Item,
dst: &mut BytesMut
) -> Result<(), Self::Error>;
}Encoding of messages as bytes, for use with FramedWrite.
Associated Types
type Item[src]
The type of items consumed by encode
type Error: From<Error>[src]
The type of encoding errors.
Required methods
fn encode(
&mut self,
item: Self::Item,
dst: &mut BytesMut
) -> Result<(), Self::Error>[src]
&mut self,
item: Self::Item,
dst: &mut BytesMut
) -> Result<(), Self::Error>
Encodes an item into the BytesMut provided by dst.
Implementors
impl Encoder for BytesCodec[src]
impl Encoder for BytesCodec[src]impl Encoder for LengthCodec[src]
impl Encoder for LengthCodec[src]