pub struct DepthLimit(/* private fields */);Expand description
A checked finite traversal depth or an explicitly unlimited traversal.
The root has depth zero. Unlimited depth retains entry and byte budgets.
Finite depths 0 through 65,533 are representable; larger values are rejected.
Both this type and Option<DepthLimit> occupy two bytes.
Implementations§
Source§impl DepthLimit
impl DepthLimit
Sourcepub const fn new(depth: usize) -> Option<DepthLimit>
pub const fn new(depth: usize) -> Option<DepthLimit>
Construct a finite limit. Out-of-range input never disables the limit.
Sourcepub const fn unlimited() -> DepthLimit
pub const fn unlimited() -> DepthLimit
Disable the depth limit while retaining other traversal budgets.
pub const fn is_unlimited(self) -> bool
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
Source§impl Default for DepthLimit
impl Default for DepthLimit
Source§fn default() -> DepthLimit
fn default() -> DepthLimit
Returns the “default value” for a type. Read more
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