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§
sourcetype Iterator<'a>: Iterator<Item = Neighbor<Graph::NodeIndex, Graph::EdgeIndex>>
where
Self: 'a,
Graph: 'a
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.
sourcetype EdgeNeighborIterator<'a>: Iterator<Item = Graph::NodeIndex>
where
Self: 'a,
Graph: 'a
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§
sourcefn neighbor_iterator(
graph: &Graph,
node: Graph::NodeIndex
) -> Self::Iterator<'_>
fn neighbor_iterator( graph: &Graph, node: Graph::NodeIndex ) -> Self::Iterator<'_>
Returns an iterator over the neighbors of a given node.
sourcefn edge_neighbor_iterator(
graph: &Graph,
edge: Graph::EdgeIndex
) -> Self::EdgeNeighborIterator<'_>
fn edge_neighbor_iterator( graph: &Graph, edge: Graph::EdgeIndex ) -> Self::EdgeNeighborIterator<'_>
Returns an iterator over the neighbors of an edge.