petgraph::visit

Trait IntoNeighbors

source
pub trait IntoNeighbors: GraphRef {
    type Neighbors: Iterator<Item = Self::NodeId>;

    // Required method
    fn neighbors(self, a: Self::NodeId) -> Self::Neighbors;
}
Expand description

Access to the neighbors of each node

The neighbors are, depending on the graph’s edge type:

  • Directed: All targets of edges from a.
  • Undirected: All other endpoints of edges connected to a.

Required Associated Types§

source

type Neighbors: Iterator<Item = Self::NodeId>

Required Methods§

source

fn neighbors(self, a: Self::NodeId) -> Self::Neighbors

Return an iterator of the neighbors of node a.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a, G> IntoNeighbors for &'a G
where G: IntoNeighbors,

Implementors§

source§

impl<'a, 'b, G> IntoNeighbors for &'b Frozen<'a, G>
where G: IntoNeighbors,

source§

impl<'a, E, Ix: IndexType> IntoNeighbors for &'a List<E, Ix>

source§

type Neighbors = Neighbors<'a, E, Ix>

source§

impl<'a, G, F> IntoNeighbors for &'a EdgeFiltered<G, F>
where G: IntoEdges, F: FilterEdge<G::EdgeRef>,

source§

impl<'a, G, F> IntoNeighbors for &'a NodeFiltered<G, F>
where G: IntoNeighbors, F: FilterNode<G::NodeId>,

source§

impl<'a, N, E, Ty, Ix> IntoNeighbors for &'a Csr<N, E, Ty, Ix>
where Ty: EdgeType, Ix: IndexType,

source§

impl<'a, N, E, Ty, S> IntoNeighbors for &'a GraphMap<N, E, Ty, S>
where N: Copy + Ord + Hash + 'a, Ty: EdgeType, S: BuildHasher,

source§

type Neighbors = Neighbors<'a, N, Ty>

source§

impl<'a, N, E: 'a, Ty, Ix> IntoNeighbors for &'a Graph<N, E, Ty, Ix>
where Ty: EdgeType, Ix: IndexType,

source§

type Neighbors = Neighbors<'a, E, Ix>

source§

impl<'a, N, E: 'a, Ty, Ix> IntoNeighbors for &'a StableGraph<N, E, Ty, Ix>
where Ty: EdgeType, Ix: IndexType,

source§

type Neighbors = Neighbors<'a, E, Ix>

source§

impl<'a, N, E: 'a, Ty: EdgeType, Null: Nullable<Wrapped = E>, Ix: IndexType> IntoNeighbors for &'a MatrixGraph<N, E, Ty, Null, Ix>

source§

type Neighbors = Neighbors<'a, Ty, Null, Ix>

source§

impl<G> IntoNeighbors for Reversed<G>