Trait petgraph::visit::IntoNeighbors[][src]

pub trait IntoNeighbors: GraphRef {
    type Neighbors: Iterator<Item = Self::NodeId>;
    fn neighbors(self, a: Self::NodeId) -> Self::Neighbors;
}

Access to the neighbors of each node

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

Associated Types

type Neighbors: Iterator<Item = Self::NodeId>[src]

Loading content...

Required methods

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

Return an iterator of the neighbors of node a.

Loading content...

Implementations on Foreign Types

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

type Neighbors = G::Neighbors

Loading content...

Implementors

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

type Neighbors = G::Neighbors

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

type Neighbors = EdgeFilteredNeighbors<'a, G, F>

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

type Neighbors = NodeFilteredNeighbors<'a, G::Neighbors, F>

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

type Neighbors = Neighbors<'a, Ix>

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

Return an iterator of all neighbors of a.

  • Directed: Targets of outgoing edges from a.
  • Undirected: Opposing endpoints of all edges connected to a.

Panics if the node a does not exist.
Iterator element type is NodeIndex<Ix>.

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

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

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

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

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

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

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

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

impl<G> IntoNeighbors for Reversed<G> where
    G: IntoNeighborsDirected
[src]

Loading content...