pub(crate) struct DecyclerGuard<'a, T, const D: usize> {
decycler: &'a mut Decycler<T, D>,
}
Fields§
§decycler: &'a mut Decycler<T, D>
Methods from Deref<Target = Decycler<T, D>>§
Sourcepub fn enter(
&mut self,
node_id: T,
) -> Result<DecyclerGuard<'_, T, D>, DecyclerError>
pub fn enter( &mut self, node_id: T, ) -> Result<DecyclerGuard<'_, T, D>, DecyclerError>
Enters a new graph node with the given value that uniquely identifies the current node.
Returns an error when a cycle is detected or the max depth of the traversal is exceeded. Otherwise, increases the current depth and returns a guard object that will decrease the depth when dropped.
The guard object derefs to the decycler, so it can be passed to a recursive traversal function to check for cycles in descendent nodes in a graph.
Trait Implementations§
Source§impl<T, const D: usize> Deref for DecyclerGuard<'_, T, D>
impl<T, const D: usize> Deref for DecyclerGuard<'_, T, D>
Source§impl<T, const D: usize> DerefMut for DecyclerGuard<'_, T, D>
impl<T, const D: usize> DerefMut for DecyclerGuard<'_, T, D>
Auto Trait Implementations§
impl<'a, T, const D: usize> Freeze for DecyclerGuard<'a, T, D>
impl<'a, T, const D: usize> RefUnwindSafe for DecyclerGuard<'a, T, D>where
T: RefUnwindSafe,
impl<'a, T, const D: usize> Send for DecyclerGuard<'a, T, D>where
T: Send,
impl<'a, T, const D: usize> Sync for DecyclerGuard<'a, T, D>where
T: Sync,
impl<'a, T, const D: usize> Unpin for DecyclerGuard<'a, T, D>
impl<'a, T, const D: usize> !UnwindSafe for DecyclerGuard<'a, T, D>
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