pub fn value_nesting_within_limit(value: &Value, max_depth: usize) -> boolExpand description
Iteratively check container-nesting depth of a runtime Value, returning
false once nesting exceeds max_depth.
Unlike the parser guards above (which bound the DSL’s own syntax tree),
values checked here come from verb handler results, e.g. a traverse or
context result about to be stored as $prev chain context, and are
otherwise unbounded. Walks an explicit worklist on the heap instead of
native recursion, so a pathologically deep result cannot overflow the
thread stack via Value::clone or serialization (CWE-674) before this
check has a chance to reject it.