pub enum Control<B> {
Continue,
Prune,
Break(B),
}
Expand description
Control flow for depth_first_search
callbacks.
Variants§
Continue
Continue the DFS traversal as normal.
Prune
Prune the current node from the DFS traversal. No more edges from this
node will be reported to the callback. A DfsEvent::Finish
for this
node will still be reported. This can be returned in response to any
DfsEvent
, except Finish
, which will panic.
Break(B)
Stop the DFS traversal and return the provided value.
Implementations§
Trait Implementations§
Source§impl<B> ControlFlow for Control<B>
impl<B> ControlFlow for Control<B>
fn continuing() -> Self
fn should_break(&self) -> bool
fn should_prune(&self) -> bool
impl<B: Copy> Copy for Control<B>
Auto Trait Implementations§
impl<B> Freeze for Control<B>where
B: Freeze,
impl<B> RefUnwindSafe for Control<B>where
B: RefUnwindSafe,
impl<B> Send for Control<B>where
B: Send,
impl<B> Sync for Control<B>where
B: Sync,
impl<B> Unpin for Control<B>where
B: Unpin,
impl<B> UnwindSafe for Control<B>where
B: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)