Skip to main content

Module cbor

Module cbor 

Source
Expand description

Concise Binary Object Representation (CBOR) formats.

This module implements the basic generic data model from RFC 8949. It is allocation-gated because recursive generic values necessarily contain Boxes and Vecs. Definite byte and text strings borrow directly from the input; allocation is needed only for fragmented strings and recursive items.

CborFmt<false> accepts the well-formed representation variants described by RFC 8949. CborFmt<true> additionally requires preferred integer, length, and tag arguments and rejects indefinite-length items (RFC 8949 section 4.2.1).

§Limitations

  • Map-key ordering is not yet enforced in CborFmt<true>.
  • Floating-point widths are retained in CborFloat, so shortest-width floating-point normalization is likewise not yet imposed.

See the CBOR guide for the runtime workflow, ownership model, and deterministic-profile scope.

Re-exports§

pub use format::CborFmt;

Modules§

format
Recursive generic-CBOR format specifications, proofs, and execution.

Structs§

CborHead
A normalized CBOR initial byte and its optional argument.
CborHeadFmt
One normalized CBOR head.
CborInitial
The two bit fields in a CBOR initial byte (RFC 8949 section 3).
CborInitialFmt
The fixed-width initial-byte bit-field format.

Enums§

CborBytes
Runtime representation of a CBOR byte string.
CborFloat
A CBOR floating-point payload.
CborHeadValue
Semantic payload carried by a decoded CBOR head.
CborText
Runtime representation of a CBOR text string.
CborValue
Generic CBOR value.
CborValueSpec
Logical value used by CBOR specifications.
MajorType
The eight CBOR major types from RFC 8949 section 3.1.

Constants§

BREAK
The CBOR break stop code (0xff).
MAX_RECURSION_DEPTH
Default maximum nesting depth for generic CBOR values.

Type Aliases§

BreakFmt
CborArray
Runtime representation of a CBOR array.
CborMap
Runtime representation of a CBOR map.