← cbor · version 0.1.13
5 public items, in source order. Generated from the registry index, which re-derives them from the package source at publish time — so a signature here is the one that version actually ships.
pub enum CborValue { CNull, CBool { pub value: boolean }, CInt { pub value: integer }, CBytes { pub value: vector<u8> }, CText { pub value: text }, CArray { pub items: vector<CborValue> }, CMap { pub entries: vector<CborEntry> } }
A dynamic CBOR value. Mirrors the stdlib JsonValue, with CBOR's extra CBytes (native byte string) and the integer split that CBOR makes at the wire level folded into one signed CInt.
pub struct CborEntry { const key: CborValue, const value: CborValue }
One key/value pair of a CMap.
pub fn encode(v: CborValue) -> vector<u8>
Encode a CborValue to canonical CBOR bytes. A map's entries are SORTED here by their encoded key bytes, so the order you built the map in never reaches the wire.
pub struct Decoded { const value: CborValue, const next: integer, const ok: boolean }
The result of decoding one CBOR value: the value, the byte position just past it (next), and ok — false on any malformed / non-canonical / truncated input, and on nesting deeper than MAX_DEPTH. Decoding never crashes (loft-safe): a bad byte stream yields ok=false rather than a trap.