pub struct Limits {
pub max_depth: u32,
pub max_elements: u64,
pub max_element_length: u64,
pub max_work: u64,
}Expand description
How much a parse may spend.
The defaults are generous, because they exist to stop a document that is trying to make this run forever, not to decide that real documents are too big. A caller on a device with less to spend lowers them.
Fields§
§max_depth: u32How deeply elements may nest.
Certificates and signed data nest perhaps a dozen deep. A thousand is a document doing something else.
max_elements: u64How many elements may be read in total.
max_element_length: u64How long a single element’s contents may be.
max_work: u64Cumulative parser and explicitly attached schema work units.
Header scanning, nested-reader paths and diagnostic copying share this
ceiling. Borrowed payload views do not scan their contents. Explicit
crate::Reader::charge and crate::Reader::execution additionally
attach schema scans and scratch to the same cumulative session; rebinding
the aggregate account does not reset it.