Skip to main content

UndirectedNeighbors

Trait UndirectedNeighbors 

Source
pub trait UndirectedNeighbors<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§

Source

type NeighborsIterator<'a>: Iterator<Item = &'a NI> where Self: 'a

Required Methods§

Source

fn neighbors(&self, node: NI) -> Self::NeighborsIterator<'_>

Returns an iterator of all nodes connected to the given node.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<NI: Idx, NV> UndirectedNeighbors<NI> for UndirectedALGraph<NI, NV, ()>

Source§

type NeighborsIterator<'a> = TargetsIter<'a, NI> where NV: 'a

Source§

impl<NI: Idx, NV> UndirectedNeighbors<NI> for UndirectedCsrGraph<NI, NV>

Source§

type NeighborsIterator<'a> = Iter<'a, NI> where NV: 'a