pub struct DepthGuard<'cx, 'a> { /* private fields */ }Expand description
RAII guard for depth tracking.
Methods from Deref<Target = InspectCx<'a>>§
Sourcepub fn limits(&self) -> &InspectLimits
pub fn limits(&self) -> &InspectLimits
Get the configured limits.
Sourcepub fn depth_exceeded(&self) -> bool
pub fn depth_exceeded(&self) -> bool
Check if the depth limit has been reached.
Sourcepub fn nodes_exceeded(&self) -> bool
pub fn nodes_exceeded(&self) -> bool
Check if the node limit has been reached.
Sourcepub fn visit_node(&mut self)
pub fn visit_node(&mut self)
Increment the node counter.
Sourcepub fn enter(&mut self) -> DepthGuard<'_, 'a>
pub fn enter(&mut self) -> DepthGuard<'_, 'a>
Enter a deeper level of traversal.
Sourcepub fn is_visited(&self, addr: usize) -> bool
pub fn is_visited(&self, addr: usize) -> bool
Check if an address has been visited (cycle detection).
Sourcepub fn mark_visited(&mut self, addr: usize)
pub fn mark_visited(&mut self, addr: usize)
Mark an address as visited.
Trait Implementations§
Source§impl<'cx, 'a> Debug for DepthGuard<'cx, 'a>
impl<'cx, 'a> Debug for DepthGuard<'cx, 'a>
Source§impl<'cx, 'a> Deref for DepthGuard<'cx, 'a>
impl<'cx, 'a> Deref for DepthGuard<'cx, 'a>
Source§impl DerefMut for DepthGuard<'_, '_>
impl DerefMut for DepthGuard<'_, '_>
Source§impl Drop for DepthGuard<'_, '_>
impl Drop for DepthGuard<'_, '_>
Auto Trait Implementations§
impl<'cx, 'a> !UnwindSafe for DepthGuard<'cx, 'a>
impl<'cx, 'a> Freeze for DepthGuard<'cx, 'a>
impl<'cx, 'a> RefUnwindSafe for DepthGuard<'cx, 'a>
impl<'cx, 'a> Send for DepthGuard<'cx, 'a>
impl<'cx, 'a> Sync for DepthGuard<'cx, 'a>
impl<'cx, 'a> Unpin for DepthGuard<'cx, 'a>
impl<'cx, 'a> UnsafeUnpin for DepthGuard<'cx, 'a>
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