const-cbor-serde
Serde Serialize / Deserialize adapters for
const-cbor, a const-first,
allocation-free CBOR (RFC 8949) codec.
The core crate stays dependency-free; this companion owns all trait
plumbing and is the only place serde appears in your graph.
use ;
let bytes = to_vec?;
let p: Point = from_slice?;
Representation
RFC 8949 does not define struct/enum mappings, so this crate follows the
ecosystem conventions of serde_cbor / ciborium for interoperability:
| Rust | CBOR |
|---|---|
| structs / maps | map keyed by field name |
| enums | externally tagged: unit variants as bare strings, others as { name: payload } |
| sequences | indefinite-length array |
Option::None, unit |
null |
char |
single-character text string |
Strings and byte slices deserialize zero-copy, borrowing from the input.
Enable the bignum feature to route i128/u128 through CBOR tags 2/3
when values exceed 64 bits.
License
MIT OR Apache-2.0