[−][src]Trait asynchronous_codec::Encoder
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
pub 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]
type Item = Bytes
type Error = Error
pub fn encode(
&mut self,
src: Self::Item,
dst: &mut BytesMut
) -> Result<(), Self::Error>
[src]
&mut self,
src: Self::Item,
dst: &mut BytesMut
) -> Result<(), Self::Error>
impl Encoder for LengthCodec
[src]
type Item = Bytes
type Error = Error
pub fn encode(
&mut self,
src: Self::Item,
dst: &mut BytesMut
) -> Result<(), Self::Error>
[src]
&mut self,
src: Self::Item,
dst: &mut BytesMut
) -> Result<(), Self::Error>
impl Encoder for LinesCodec
[src]
type Item = String
type Error = Error
pub 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>
impl<Enc, Dec> Encoder for CborCodec<Enc, Dec> where
Dec: Deserialize<'de> + 'static,
Enc: Serialize + 'static,
[src]
Dec: Deserialize<'de> + 'static,
Enc: Serialize + 'static,
Encoder impl encodes object streams to bytes
type Item = Enc
type Error = CborCodecError
pub fn encode(
&mut self,
data: Self::Item,
buf: &mut BytesMut
) -> Result<(), Self::Error>
[src]
&mut self,
data: Self::Item,
buf: &mut BytesMut
) -> Result<(), Self::Error>
impl<Enc, Dec> Encoder for JsonCodec<Enc, Dec> where
Dec: Deserialize<'de> + 'static,
Enc: Serialize + 'static,
[src]
Dec: Deserialize<'de> + 'static,
Enc: Serialize + 'static,
Encoder impl encodes object streams to bytes