Skip to main content

MAX_DEPTH

Constant MAX_DEPTH 

Source
pub const MAX_DEPTH: usize = 64;
Expand description

How deeply elements may nest before the document is refused.

An ordinary .ork design nests 11 deep, and the deepest of the 76 in the reference corpus (OpenRocket’s own parallel-booster example) reaches 17, so 64 leaves room to spare. The limit is here because both the XML parser underneath and this module’s own reader descend the tree: a file written to nest far enough exhausts the stack, which is a crash where Loft lesson L56: malformed input must give an error rather than crash asks for an error. On a debug test build with a 2 MiB stack, roxmltree read 120 levels and died on 130, so the depth is counted before the text is handed to it.