pub struct ParseOptions {
pub max_bytes: usize,
pub max_nodes: usize,
pub max_depth: usize,
pub max_attributes: usize,
}Expand description
Resource budgets for parsing untrusted ILCD+EPD XML.
Fields§
§max_bytes: usizeMaximum UTF-8 input bytes.
max_nodes: usizeMaximum XML nodes, including text and comments.
max_depth: usizeMaximum nested element depth, counting the root as one.
max_attributes: usizeMaximum attributes on one element.
Implementations§
Source§impl ParseOptions
impl ParseOptions
Sourcepub const fn with_max_bytes(self, max_bytes: usize) -> Self
pub const fn with_max_bytes(self, max_bytes: usize) -> Self
Returns these limits with a different byte budget.
Sourcepub const fn with_max_nodes(self, max_nodes: usize) -> Self
pub const fn with_max_nodes(self, max_nodes: usize) -> Self
Returns these limits with a different node budget.
Sourcepub const fn with_max_depth(self, max_depth: usize) -> Self
pub const fn with_max_depth(self, max_depth: usize) -> Self
Returns these limits with a different element-depth budget.
Sourcepub const fn with_max_attributes(self, max_attributes: usize) -> Self
pub const fn with_max_attributes(self, max_attributes: usize) -> Self
Returns these limits with a different per-element attribute budget.
Trait Implementations§
Source§impl Clone for ParseOptions
impl Clone for ParseOptions
Source§fn clone(&self) -> ParseOptions
fn clone(&self) -> ParseOptions
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParseOptions
impl Debug for ParseOptions
Source§impl Default for ParseOptions
impl Default for ParseOptions
Source§impl PartialEq for ParseOptions
impl PartialEq for ParseOptions
impl Copy for ParseOptions
impl Eq for ParseOptions
impl StructuralPartialEq for ParseOptions
Auto Trait Implementations§
impl Freeze for ParseOptions
impl RefUnwindSafe for ParseOptions
impl Send for ParseOptions
impl Sync for ParseOptions
impl Unpin for ParseOptions
impl UnwindSafe for ParseOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more