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.

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.

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: '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<G> IntoNeighbors for Reversed<G>