Trait graph::prelude::UndirectedNeighbors
source · pub trait UndirectedNeighbors<NI>where
NI: Idx,{
type NeighborsIterator<'a>: Iterator<Item = &'a NI>
where Self: 'a;
// Required method
fn neighbors(&self, node: NI) -> Self::NeighborsIterator<'_>;
}
Expand description
Returns the neighbors of a given node.
The edge (42, 1337)
is equivalent to the edge (1337, 42)
.
Required Associated Types§
type NeighborsIterator<'a>: Iterator<Item = &'a NI> where Self: 'a
Required Methods§
sourcefn neighbors(&self, node: NI) -> Self::NeighborsIterator<'_>
fn neighbors(&self, node: NI) -> Self::NeighborsIterator<'_>
Returns an iterator of all nodes connected to the given node.
Object Safety§
This trait is not object safe.