#[non_exhaustive]pub struct Limits {
pub nodes: u32,
pub depth: u32,
pub attributes: u32,
pub namespaces: u32,
}Expand description
Bounds on what a document may contain, against hostile input. The defaults are those
of roxmltree 0.21, so that a document is refused by a limit exactly when it
refuses it.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.nodes: u32Nodes in the document, the document node, elements, text nodes (adjacent
character data and CDATA sections being one node), comments and processing
instructions counted: Error::NodesLimitReached when a node would be the
nodes-th. Default u32::MAX.
depth: u32Depth of element nesting, the document element at depth 1:
Error::DepthLimitReached beyond. Default u32::MAX.
attributes: u32Attributes in the document, namespace declarations not counted:
Error::AttributesLimitReached when the attributes of an element would bring
the count to attributes. Default u32::MAX.
namespaces: u32Distinct (prefix, namespace name) declarations in the document, the predefined
xml prefix counted: Error::NamespacesLimitReached when a new one would
bring the count to namespaces. Default 65536.
Implementations§
Source§impl Limits
impl Limits
Sourcepub const fn with_nodes(self, nodes: u32) -> Self
pub const fn with_nodes(self, nodes: u32) -> Self
The defaults with another node limit.
Sourcepub const fn with_depth(self, depth: u32) -> Self
pub const fn with_depth(self, depth: u32) -> Self
The defaults with another depth limit.
Sourcepub const fn with_attributes(self, attributes: u32) -> Self
pub const fn with_attributes(self, attributes: u32) -> Self
The defaults with another attribute limit.
Sourcepub const fn with_namespaces(self, namespaces: u32) -> Self
pub const fn with_namespaces(self, namespaces: u32) -> Self
The defaults with another namespace limit.