Skip to main content

uor_addr/cbor/shapes/
bounds.rs

1//! CBOR realization grammar constant.
2//!
3//! Per ADR-060 there are no byte/count ceilings: byte-string and
4//! text-string widths, array-element and map-entry counts, integer
5//! magnitudes, and total document size are unbounded — the canonicalizer
6//! materializes the RFC 8949 §4.2 canonical form in an `alloc` buffer and
7//! the input flows through the pipeline as a borrowed carrier.
8//!
9//! The single remaining bound is a **native-stack-overflow guard** for the
10//! recursive-descent CBOR parser/canonicalizer.
11
12/// Maximum data-item nesting depth the recursive-descent
13/// parser/canonicalizer will descend before reporting a depth-bound
14/// violation. Guards the native call stack against pathologically-nested
15/// input; it is not a ceiling on document size, element count, or value
16/// width.
17pub const MAX_CBOR_DEPTH: usize = 1024;