Crate oasis_cbor

source ·
Expand description

Convenience functions for dealing with CBOR encodings.

Re-exports

pub use crate::decode::Decode;
pub use crate::encode::Encode;
pub use crate::encode::EncodeAsMap;

Modules

CBOR decoding.
CBOR encoding.
Convenience macros for working with CBOR values.
Functionality for deserializing CBOR data into values.
Types for expressing CBOR values.
Functionality for serializing CBOR values into bytes.

Macros

Assert that the keys in a vector of key-value pairs are in canonical order.
Creates a CBOR Value of type Array with the given elements.
Creates a CBOR Value of type Array from a Vec.
Creates a CBOR Value of type Simple with the given bool value.
Creates a CBOR Value of type Byte String with the given slice or vector.
Creates a CBOR Value of type Byte String with the given byte string literal.
Creates a CBOR Value of type Simple with value false.
Creates a CBOR Value of type Unsigned or Negative with the given numeric value.
Creates a CBOR Value of type Map with the specified key-value pairs.
Creates a CBOR Value of type Map from a Vec<(Value, Value)>.
Creates a CBOR Value of type Map with key-value pairs where values can be Options.
Creates a CBOR Value of type Simple with value null.
Creates a CBOR Value of type Tag with the given tag and object.
Creates a CBOR Value of type Text String with the given string.
Creates a CBOR Value of type Simple with value true.
Creates a CBOR Value of type Simple with the undefined value.
Creates a CBOR Value of type Unsigned with the given numeric value.
This macro generates code to extract multiple values from a Vec<(Value, Value)> at once in an optimized manner, consuming the input vector.

Enums

Error encountered during decoding.
Specific simple CBOR values.
Possible CBOR values.

Functions

Convert CBOR-encoded data into the given type.
Convert CBOR-encoded data into the given type using non-strict decoding.
Convert high-level CBOR representation into the given type.
Deserialize CBOR binary data to produce a single Value, expecting that there is no additional data. Maximum level of nesting supported is 127; more deeply nested structures will fail with DecoderError::TooMuchNesting.
Convert the given type into its high-level CBOR representation.
Convert the given type into its CBOR-encoded representation.
Convert a Value to serialized CBOR data, consuming it along the way and appending to the provided vector. Maximum level of nesting supported is 127; more deeply nested structures will fail with EncoderError::TooMuchNesting.

Derive Macros

Derives the Decode trait.
Derives the Encode trait.