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.

Implementors§

source§

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

§

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

§

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

source§

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

§

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

§

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

source§

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

§

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

§

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