pub struct DepthLimit(/* private fields */);Expand description
Compact traversal depth: 0 through 200 are finite, larger inputs are unlimited.
The root has depth zero. Unlimited depth does not disable entry/byte budgets.
Both this type and Option<DepthLimit> occupy one byte.
Implementations§
Source§impl DepthLimit
impl DepthLimit
Sourcepub const fn new(depth: usize) -> DepthLimit
pub const fn new(depth: usize) -> DepthLimit
Normalize a requested depth. Every value above 200 means unlimited.
Sourcepub const fn unlimited() -> DepthLimit
pub const fn unlimited() -> DepthLimit
Disable the depth limit while retaining other traversal budgets.
Sourcepub const fn is_unlimited(self) -> bool
pub const fn is_unlimited(self) -> bool
Whether traversal has no depth limit.
Trait Implementations§
Source§impl Clone for DepthLimit
impl Clone for DepthLimit
Source§fn clone(&self) -> DepthLimit
fn clone(&self) -> DepthLimit
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DepthLimit
Source§impl Debug for DepthLimit
impl Debug for DepthLimit
impl Eq for DepthLimit
Source§impl PartialEq for DepthLimit
impl PartialEq for DepthLimit
impl StructuralPartialEq for DepthLimit
Auto Trait Implementations§
impl Freeze for DepthLimit
impl RefUnwindSafe for DepthLimit
impl Send for DepthLimit
impl Sync for DepthLimit
impl Unpin for DepthLimit
impl UnsafeUnpin for DepthLimit
impl UnwindSafe for DepthLimit
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