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> 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