pub struct InspectCx<'a> { /* private fields */ }Expand description
Context for an inspection session.
Carries configuration, limits, and traversal state through the inspection process to ensure safety and respect resource constraints.
Implementations§
Source§impl<'a> InspectCx<'a>
impl<'a> InspectCx<'a>
Sourcepub fn with_limits(limits: InspectLimits) -> Self
pub fn with_limits(limits: InspectLimits) -> Self
Create a new inspection context with specific limits.
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§
Auto Trait Implementations§
impl<'a> Freeze for InspectCx<'a>
impl<'a> RefUnwindSafe for InspectCx<'a>
impl<'a> Send for InspectCx<'a>
impl<'a> Sync for InspectCx<'a>
impl<'a> Unpin for InspectCx<'a>
impl<'a> UnsafeUnpin for InspectCx<'a>
impl<'a> UnwindSafe for InspectCx<'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