Skip to main content

uor_addr/json/shapes/
bounds.rs

1//! JSON realization grammar constant.
2//!
3//! ADR-060 removed the fixed-buffer capacity profile (this module's old
4//! `AddrBounds`, now the shared [`crate::bounds::AddrBounds`]) and every
5//! byte/count ceiling it implied (`JSON_VALUE_MAX_BYTES`,
6//! `MAX_STRING_BYTES`, `MAX_NUMBER_DIGITS`, `MAX_OBJECT_KEYS`,
7//! `MAX_ARRAY_ELEMENTS`). String widths, number widths, object-key
8//! counts, array-element counts, and total document size are unbounded:
9//! the canonicalizer materializes the canonical form in an `alloc` buffer
10//! and the input flows through the pipeline as a borrowed carrier.
11//!
12//! The single remaining bound is a **native-stack-overflow guard** for
13//! the recursive-descent JSON parser/canonicalizer.
14
15/// Maximum value-nesting depth the recursive-descent parser/canonicalizer
16/// will descend before reporting a depth-bound violation. Guards the
17/// native call stack against pathologically-nested input; it is not a
18/// ceiling on document size, member count, or value width.
19pub const MAX_JSON_DEPTH: usize = 1024;