pub struct Limits {
pub max_depth: u32,
pub max_objects: u32,
pub max_decoded_size: u64,
pub max_compression_ratio: u64,
pub ratio_floor: u64,
pub max_xref_sections: u32,
pub max_object_size: u64,
pub max_pages: u32,
pub budget: Option<Arc<dyn Budget>>,
}Expand description
Limits applied while reading. Every one is enforced; exceeding one is an
error (crate::Error::Limit), never a panic or unbounded work.
Fields§
§max_depth: u32Nesting depth of arrays and dictionaries within one object, and of reference chains followed while resolving.
max_objects: u32Highest object number accepted from an xref section or a scan.
max_decoded_size: u64Maximum decoded size of one stream, in bytes.
max_compression_ratio: u64Maximum ratio of decoded to encoded size for one stream, applied once
the output passes Limits::ratio_floor bytes.
ratio_floor: u64Decoded size below which the ratio is not checked: small streams legitimately compress far better than large ones.
max_xref_sections: u32Maximum number of xref sections followed through /Prev.
max_object_size: u64Maximum size of one object’s syntax, excluding stream data.
max_pages: u32Maximum number of pages enumerated.
budget: Option<Arc<dyn Budget>>Optional CPU budget hook.