pub trait Sequential<A: Event> {
// Required methods
fn visit_filtered_with<R: IntoIterator<Item = usize>, T, E, C: FnMut(&mut T, A) -> ControlFlow<E, ()>, F: FnMut(&mut T, A::FilterArgs) -> bool>(
&mut self,
roots: R,
init: T,
callback: C,
filter: F,
) -> ControlFlow<E, ()>;
fn reset(&mut self);
// Provided methods
fn visit_filtered<R: IntoIterator<Item = usize>, E, C: FnMut(A) -> ControlFlow<E, ()>, F: FnMut(A::FilterArgs) -> bool>(
&mut self,
roots: R,
callback: C,
filter: F,
) -> ControlFlow<E, ()> { ... }
fn visit_with<R: IntoIterator<Item = usize>, T, E, C: FnMut(&mut T, A) -> ControlFlow<E, ()>>(
&mut self,
roots: R,
init: T,
callback: C,
) -> ControlFlow<E, ()> { ... }
fn visit<R: IntoIterator<Item = usize>, E, C: FnMut(A) -> ControlFlow<E, ()>>(
&mut self,
roots: R,
callback: C,
) -> ControlFlow<E, ()> { ... }
}
Expand description
A sequential visit.
Implementation of this trait must provide the
visit_filtered_with
method, which
should perform a visit of a graph starting from a given set of nodes. Note
that different visits types might interpret the set of nodes differently:
for example, a breadth-first visit will interpret the set
of nodes as the initial queue, whereas a depth-first visit
will interpret the set of nodes as a list of nodes from which to start
visits.
Required Methods§
Sourcefn visit_filtered_with<R: IntoIterator<Item = usize>, T, E, C: FnMut(&mut T, A) -> ControlFlow<E, ()>, F: FnMut(&mut T, A::FilterArgs) -> bool>(
&mut self,
roots: R,
init: T,
callback: C,
filter: F,
) -> ControlFlow<E, ()>
fn visit_filtered_with<R: IntoIterator<Item = usize>, T, E, C: FnMut(&mut T, A) -> ControlFlow<E, ()>, F: FnMut(&mut T, A::FilterArgs) -> bool>( &mut self, roots: R, init: T, callback: C, filter: F, ) -> ControlFlow<E, ()>
Visits the graph from the specified nodes with an initialization value and a filter function.
§Arguments
-
roots
: The nodes to start the visit from. -
init
: a value the will be passed to the callback function. -
callback
: The callback function. -
filter
: The filter function.
Provided Methods§
Sourcefn visit_filtered<R: IntoIterator<Item = usize>, E, C: FnMut(A) -> ControlFlow<E, ()>, F: FnMut(A::FilterArgs) -> bool>(
&mut self,
roots: R,
callback: C,
filter: F,
) -> ControlFlow<E, ()>
fn visit_filtered<R: IntoIterator<Item = usize>, E, C: FnMut(A) -> ControlFlow<E, ()>, F: FnMut(A::FilterArgs) -> bool>( &mut self, roots: R, callback: C, filter: F, ) -> ControlFlow<E, ()>
Visits the graph from the specified nodes with a filter function.
§Arguments
-
roots
: The nodes to start the visit from. -
callback
: The callback function. -
filter
: The filter function.
Sourcefn visit_with<R: IntoIterator<Item = usize>, T, E, C: FnMut(&mut T, A) -> ControlFlow<E, ()>>(
&mut self,
roots: R,
init: T,
callback: C,
) -> ControlFlow<E, ()>
fn visit_with<R: IntoIterator<Item = usize>, T, E, C: FnMut(&mut T, A) -> ControlFlow<E, ()>>( &mut self, roots: R, init: T, callback: C, ) -> ControlFlow<E, ()>
Visits the graph from the specified nodes with an initialization value.
§Arguments
-
roots
: The nodes to start the visit from. -
init
: a value the will be passed to the callback function. -
callback
: The callback function.
Sourcefn visit<R: IntoIterator<Item = usize>, E, C: FnMut(A) -> ControlFlow<E, ()>>(
&mut self,
roots: R,
callback: C,
) -> ControlFlow<E, ()>
fn visit<R: IntoIterator<Item = usize>, E, C: FnMut(A) -> ControlFlow<E, ()>>( &mut self, roots: R, callback: C, ) -> ControlFlow<E, ()>
Visits the graph from the specified nodes.
§Arguments
-
roots
: The nodes to start the visit from. -
callback
: The callback function.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.