Struct tokio_serde_cbor::Codec [] [src]

pub struct Codec<Dec, Enc> { /* fields omitted */ }

Cbor serializer and deserializer.

This is just a combined Decoder and Encoder.

Methods

impl<'de, Dec: Deserialize<'de>, Enc: Serialize> Codec<Dec, Enc>
[src]

Creates a new codec

Turns the internal encoder into one with confifured self-describe behaviour.

Turns the internal encoder into one with configured packed encoding.

If packed is true, it omits the field names from the encoded data. That makes it smaller, but it also means the decoding end must know the exact order of fields and it can't be something like python, which would want to get a dictionary out of it.

Trait Implementations

impl<Dec: Clone, Enc: Clone> Clone for Codec<Dec, Enc>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<Dec: Debug, Enc: Debug> Debug for Codec<Dec, Enc>
[src]

Formats the value using the given formatter.

impl<'de, Dec: Deserialize<'de>, Enc: Serialize> Default for Codec<Dec, Enc>
[src]

Returns the "default value" for a type. Read more

impl<'de, Dec: Deserialize<'de>, Enc: Serialize> IoDecoder for Codec<Dec, Enc>
[src]

The type of decoded frames.

The type of unrecoverable frame decoding errors. Read more

Attempts to decode a frame from the provided buffer of bytes. Read more

A default method available to be called when there are no more bytes available to be read from the underlying I/O. Read more

impl<'de, Dec: Deserialize<'de>, Enc: Serialize> IoEncoder for Codec<Dec, Enc>
[src]

The type of items consumed by the Encoder

The type of encoding errors. Read more

Encodes a frame into the buffer provided. Read more