pub struct Depth(/* private fields */);Expand description
A saturating u32 counter for nesting-depth tracking.
All arithmetic uses saturating semantics: inc() saturates at u32::MAX
(effectively unreachable for real documents), and dec() saturates at 0.
This prevents underflow when malformed input would otherwise cause it,
in line with the project’s fail-fast policy: a stuck-at-zero counter
surfaces as an invalid-sequence error downstream rather than a panic.
Implementations§
Trait Implementations§
impl Copy for Depth
impl Eq for Depth
impl StructuralPartialEq for Depth
Auto Trait Implementations§
impl Freeze for Depth
impl RefUnwindSafe for Depth
impl Send for Depth
impl Sync for Depth
impl Unpin for Depth
impl UnsafeUnpin for Depth
impl UnwindSafe for Depth
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