Struct tokio_serde_cbor::Decoder
[−]
[src]
pub struct Decoder<Item> { /* fields omitted */ }
CBOR based decoder.
This decoder can be used with tokio_io
's Framed
to decode CBOR encoded frames. Anything
that is serde
s Deserialize
can be decoded this way.
Methods
impl<'de, Item: Deserialize<'de>> Decoder<Item>
[src]
fn new() -> Self
Creates a new decoder.
Trait Implementations
impl<Item: Clone> Clone for Decoder<Item>
[src]
fn clone(&self) -> Decoder<Item>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<Item: Debug> Debug for Decoder<Item>
[src]
impl<'de, Item: Deserialize<'de>> Default for Decoder<Item>
[src]
impl<'de, Item: Deserialize<'de>> IoDecoder for Decoder<Item>
[src]
type Item = Item
The type of decoded frames.
type Error = CborError
The type of unrecoverable frame decoding errors. Read more
fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Item>, CborError>
Attempts to decode a frame from the provided buffer of bytes. Read more
fn decode_eof(
&mut self,
buf: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>
&mut self,
buf: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>
A default method available to be called when there are no more bytes available to be read from the underlying I/O. Read more