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§
- decode
- CBOR decoding.
- encode
- CBOR encoding.
- reader
- Functionality for deserializing CBOR data into values.
- values
- Types for expressing CBOR values.
- writer
- Functionality for serializing CBOR values into bytes.
Macros§
- assert_
sorted_ keys - Assert that the keys in a vector of key-value pairs are in canonical order.
- cbor_
array - Creates a CBOR Value of type Array with the given elements.
- cbor_
array_ vec - Creates a CBOR Value of type Array from a Vec
. - cbor_
bool - Creates a CBOR Value of type Simple with the given bool value.
- cbor_
bytes - Creates a CBOR Value of type Byte String with the given slice or vector.
- cbor_
bytes_ lit - Creates a CBOR Value of type Byte String with the given byte string literal.
- cbor_
false - Creates a CBOR Value of type Simple with value false.
- cbor_
int - Creates a CBOR Value of type Unsigned or Negative with the given numeric value.
- cbor_
map - Creates a CBOR Value of type Map with the specified key-value pairs.
- cbor_
map_ collection - Creates a CBOR Value of type Map from a Vec<(Value, Value)>.
- cbor_
map_ options - Creates a CBOR Value of type Map with key-value pairs where values can be Options.
- cbor_
null - Creates a CBOR Value of type Simple with value null.
- cbor_
tagged - Creates a CBOR Value of type Tag with the given tag and object.
- cbor_
text - Creates a CBOR Value of type Text String with the given string.
- cbor_
true - Creates a CBOR Value of type Simple with value true.
- cbor_
undefined - Creates a CBOR Value of type Simple with the undefined value.
- cbor_
unsigned - Creates a CBOR Value of type Unsigned with the given numeric value.
- destructure_
cbor_ map - This macro generates code to extract multiple values from a
Vec<(Value, Value)>at once in an optimized manner, consuming the input vector.
Enums§
- Decode
Error - Error encountered during decoding.
- Simple
Value - Specific simple CBOR values.
- Value
- Possible CBOR values.
Functions§
- from_
slice - Convert CBOR-encoded data into the given type.
- from_
slice_ non_ strict - Convert CBOR-encoded data into the given type using non-strict decoding.
- from_
value - Convert high-level CBOR representation into the given type.
- read
- 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 withDecoderError::TooMuchNesting. - to_
value - Convert the given type into its high-level CBOR representation.
- to_vec
- Convert the given type into its CBOR-encoded representation.
- write
- Convert a
Valueto 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 withEncoderError::TooMuchNesting.