Expand description
Module implement simple and easy CBOR serialization.
Why use custom cbor implementation while there are off-the-self solutions ?
Because CBOR specification itself is open-ended, and custom implementation means, we can mold it to the needs of distributed apps. This implementation is also tuned for big-data and document databases.
Use cbordata-derive package for procedural-macro Cborize, can be used on
any struct or enum to implement IntoCbor and FromCbor trait for the derived
struct or enum. Note that Cborize expects an associated constant ID. Refer
to get_cborize_id for details.
§Features
Macros§
- err_at
- Short form to compose Error values.
Enums§
- Cbor
- Cbor type enumerated over its major variants.
- Error
- Error variants that can be returned by this package’s API.
- Info
- 5-bit value for additional info. Refer to Cbor spec for details.
- Key
- Possible types that can be used as a key in cbor-map.
- Simple
Value - Major type 7, simple-value. Refer to Cbor spec for details.
- Tag
- Major type 6, Tag values. Refer to Cbor spec for details.
Constants§
- RECURSION_
LIMIT - Recursion limit for nested Cbor objects.
Traits§
- From
Cbor - Convert from Cbor, the cbor value is typically obtained by decoding it from bytes.
- Into
Cbor - Convert rust-native value to Cbor, which can then be encoded into bytes using Cbor.
Functions§
- get_
cborize_ id - Get unique ID associated with user-defined type.
- pretty_
print - Return pretty formated string representing
val.
Type Aliases§
- Result
- Result type, for jsondata functions and methods, that require a success or failure variant.