Trait asynchronous_codec::Encoder
source · pub trait Encoder {
type Item;
type Error: From<Error>;
fn encode(
&mut self,
item: Self::Item,
dst: &mut BytesMut
) -> Result<(), Self::Error>;
}Expand description
Encoding of messages as bytes, for use with FramedWrite.
Required Associated Types
Required Methods
Implementors
sourceimpl<Enc, Dec> Encoder for CborCodec<Enc, Dec>where
for<'de> Dec: Deserialize<'de> + 'static,
for<'de> Enc: Serialize + 'static,
impl<Enc, Dec> Encoder for CborCodec<Enc, Dec>where
for<'de> Dec: Deserialize<'de> + 'static,
for<'de> Enc: Serialize + 'static,
Encoder impl encodes object streams to bytes
type Item = Enc
type Error = CborCodecError
sourceimpl<Enc, Dec> Encoder for JsonCodec<Enc, Dec>where
for<'de> Dec: Deserialize<'de> + 'static,
for<'de> Enc: Serialize + 'static,
impl<Enc, Dec> Encoder for JsonCodec<Enc, Dec>where
for<'de> Dec: Deserialize<'de> + 'static,
for<'de> Enc: Serialize + 'static,
Encoder impl encodes object streams to bytes