Trait TraversalNeighborStrategy

Source
pub trait TraversalNeighborStrategy<Graph: GraphBase> {
    type Iterator<'a>: Iterator<Item = Neighbor<Graph::NodeIndex, Graph::EdgeIndex>>
       where Self: 'a,
             Graph: 'a;
    type EdgeNeighborIterator<'a>: Iterator<Item = Graph::NodeIndex>
       where Self: 'a,
             Graph: 'a;

    // Required methods
    fn neighbor_iterator(
        graph: &Graph,
        node: Graph::NodeIndex,
    ) -> Self::Iterator<'_>;
    fn edge_neighbor_iterator(
        graph: &Graph,
        edge: Graph::EdgeIndex,
    ) -> Self::EdgeNeighborIterator<'_>;
}
Expand description

A type that defines the strategy for computing the neighborhood of a node or edge, i.e. forward, backward or undirected.

Required Associated Types§

Source

type Iterator<'a>: Iterator<Item = Neighbor<Graph::NodeIndex, Graph::EdgeIndex>> where Self: 'a, Graph: 'a

The iterator type used to iterate over the neighbors of a node.

Source

type EdgeNeighborIterator<'a>: Iterator<Item = Graph::NodeIndex> where Self: 'a, Graph: 'a

The iterator type used to iterate over the neighbors of an edge.

Required Methods§

Source

fn neighbor_iterator( graph: &Graph, node: Graph::NodeIndex, ) -> Self::Iterator<'_>

Returns an iterator over the neighbors of a given node.

Source

fn edge_neighbor_iterator( graph: &Graph, edge: Graph::EdgeIndex, ) -> Self::EdgeNeighborIterator<'_>

Returns an iterator over the neighbors of an edge.

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<Graph: NavigableGraph + ImmutableGraphContainer> TraversalNeighborStrategy<Graph> for BackwardNeighborStrategy

Source§

type Iterator<'a> = <Graph as NavigableGraph>::InNeighbors<'a> where Self: 'a, Graph: 'a

Source§

type EdgeNeighborIterator<'a> = Once<<Graph as GraphBase>::NodeIndex> where Graph: 'a

Source§

impl<Graph: NavigableGraph + ImmutableGraphContainer> TraversalNeighborStrategy<Graph> for ForwardNeighborStrategy

Source§

type Iterator<'a> = <Graph as NavigableGraph>::OutNeighbors<'a> where Self: 'a, Graph: 'a

Source§

type EdgeNeighborIterator<'a> = Once<<Graph as GraphBase>::NodeIndex> where Graph: 'a

Source§

impl<Graph: NavigableGraph + ImmutableGraphContainer> TraversalNeighborStrategy<Graph> for UndirectedNeighborStrategy

Source§

type Iterator<'a> = Chain<<<Graph as NavigableGraph>::OutNeighbors<'a> as IntoIterator>::IntoIter, <<Graph as NavigableGraph>::InNeighbors<'a> as IntoIterator>::IntoIter> where Self: 'a, Graph: 'a

Source§

type EdgeNeighborIterator<'a> = Chain<Once<<Graph as GraphBase>::NodeIndex>, Once<<Graph as GraphBase>::NodeIndex>> where Graph: 'a