Trait Sequential

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

Source

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.

Source

fn reset(&mut self)

Resets the visit status, making it possible to reuse it.

Provided Methods§

Source

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.

Source

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.

Source

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.

Implementors§

Source§

impl<G: RandomAccessGraph> Sequential<EventPred> for Seq<G>

Source§

impl<S: NodeStates, G: RandomAccessGraph> Sequential<EventPred> for SeqIter<'_, S, G, usize, true>