[−][src]Trait asynchronous_codec::Decoder
Decoding of frames via buffers, for use with FramedRead.
Associated Types
type Item[src]
The type of items returned by decode
type Error: From<Error>[src]
The type of decoding errors.
Required methods
pub fn decode(
&mut self,
src: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>[src]
&mut self,
src: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>
Decode an item from the src BytesMut into an item
Provided methods
pub fn decode_eof(
&mut self,
src: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>[src]
&mut self,
src: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>
Called when the input stream reaches EOF, signaling a last attempt to decode
Notes
The default implementation of this method invokes the Decoder::decode method.
Implementors
impl Decoder for BytesCodec[src]
type Item = Bytes
type Error = Error
pub fn decode(
&mut self,
src: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>[src]
&mut self,
src: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>
impl Decoder for LengthCodec[src]
type Item = Bytes
type Error = Error
pub fn decode(
&mut self,
src: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>[src]
&mut self,
src: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>
impl Decoder for LinesCodec[src]
type Item = String
type Error = Error
pub fn decode(
&mut self,
src: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>[src]
&mut self,
src: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>
impl<Enc, Dec> Decoder for CborCodec<Enc, Dec> where
Dec: Deserialize<'de> + 'static,
Enc: Serialize + 'static, [src]
Dec: Deserialize<'de> + 'static,
Enc: Serialize + 'static,
Decoder impl parses cbor objects from bytes
type Item = Dec
type Error = CborCodecError
pub fn decode(
&mut self,
buf: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>[src]
&mut self,
buf: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>
impl<Enc, Dec> Decoder for JsonCodec<Enc, Dec> where
Dec: Deserialize<'de> + 'static,
Enc: Serialize + 'static, [src]
Dec: Deserialize<'de> + 'static,
Enc: Serialize + 'static,
Decoder impl parses json objects from bytes