pub struct NavigationContext { /* private fields */ }Expand description
Context for tracking recursive navigation
Implementations§
Sourcepub fn with_max_depth(max_depth: usize) -> Self
pub fn with_max_depth(max_depth: usize) -> Self
Create a new navigation context with custom max depth
Sourcepub fn at_max_depth(&self) -> bool
pub fn at_max_depth(&self) -> bool
Check if we’ve reached the max depth
Sourcepub fn descend(&mut self) -> Result<DepthGuard<'_>>
pub fn descend(&mut self) -> Result<DepthGuard<'_>>
Descend one level, returning a guard that auto-decrements on drop
§Errors
If recursion depth would exceed max_depth
Sourcepub fn is_visited(&self, path: &PathBuf) -> bool
pub fn is_visited(&self, path: &PathBuf) -> bool
Check if a path has been visited
Sourcepub fn mark_visited(&mut self, path: PathBuf)
pub fn mark_visited(&mut self, path: PathBuf)
Mark a path as visited
Sourcepub fn clear_visited(&mut self)
pub fn clear_visited(&mut self)
Clear the visited set (for testing)
Sourcepub fn num_visited(&self) -> usize
pub fn num_visited(&self) -> usize
Get the number of visited files
Trait Implementations§
Auto Trait Implementations§
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