Skip to main content

DepthGuard

Struct DepthGuard 

Source
pub struct DepthGuard<'cx, 'a> { /* private fields */ }
Expand description

RAII guard for depth tracking.

Methods from Deref<Target = InspectCx<'a>>§

Source

pub fn limits(&self) -> &InspectLimits

Get the configured limits.

Source

pub fn depth(&self) -> usize

Get the current traversal depth.

Source

pub fn depth_exceeded(&self) -> bool

Check if the depth limit has been reached.

Source

pub fn nodes_exceeded(&self) -> bool

Check if the node limit has been reached.

Source

pub fn visit_node(&mut self)

Increment the node counter.

Source

pub fn enter(&mut self) -> DepthGuard<'_, 'a>

Enter a deeper level of traversal.

Source

pub fn is_visited(&self, addr: usize) -> bool

Check if an address has been visited (cycle detection).

Source

pub fn mark_visited(&mut self, addr: usize)

Mark an address as visited.

Trait Implementations§

Source§

impl<'cx, 'a> Debug for DepthGuard<'cx, 'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'cx, 'a> Deref for DepthGuard<'cx, 'a>

Source§

type Target = InspectCx<'a>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<DepthGuard<'cx, 'a> as Deref>::Target

Dereferences the value.
Source§

impl DerefMut for DepthGuard<'_, '_>

Source§

fn deref_mut(&mut self) -> &mut <DepthGuard<'_, '_> as Deref>::Target

Mutably dereferences the value.
Source§

impl Drop for DepthGuard<'_, '_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.