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(super) fn enter(
&mut self,
node_id: T,
) -> Result<DecyclerGuard<'_, T, D>, DecyclerError>
pub(super) fn enter( &mut self, node_id: T, ) -> Result<DecyclerGuard<'_, T, D>, DecyclerError>
Enters the node uniquely identified by node_id.
Returns an error if a cycle is detected or the depth limit is reached. Otherwise, increases the depth and returns a guard that decreases it when dropped.
The guard dereferences to the decycler, so a recursive traversal can pass it down to check child nodes.
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>
Source§impl<T, const D: usize> Drop for DecyclerGuard<'_, T, D>
impl<T, const D: usize> Drop for DecyclerGuard<'_, T, D>
Auto Trait Implementations§
impl<'a, T, const D: usize> !UnwindSafe for DecyclerGuard<'a, T, D>
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> UnsafeUnpin 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