DirectedNeighbors

Trait DirectedNeighbors 

Source
pub trait DirectedNeighbors<NI: Idx> {
    type NeighborsIterator<'a>: Iterator<Item = &'a NI>
       where Self: 'a;

    // Required methods
    fn out_neighbors(&self, node: NI) -> Self::NeighborsIterator<'_>;
    fn in_neighbors(&self, node: NI) -> Self::NeighborsIterator<'_>;
}
Expand description

Returns the neighbors of a given node either in outgoing or incoming direction.

An edge tuple e = (u, v) has a source node u and a target node v. From the perspective of u, the edge e is an outgoing edge. From the perspective of node v, the edge e is an incoming edge. The edges (u, v) and (v, u) are not considered equivalent.

Required Associated Types§

Source

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

Required Methods§

Source

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

Returns an iterator of all nodes which are connected in outgoing direction to the given node, i.e., the given node is the source node of the connecting edge.

Source

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

Returns an iterator of all nodes which are connected in incoming direction to the given node, i.e., the given node is the target node of the connecting edge.

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.

Implementors§

Source§

impl<NI: Idx, NV> DirectedNeighbors<NI> for DirectedALGraph<NI, NV, ()>

Source§

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

Source§

impl<NI: Idx, NV> DirectedNeighbors<NI> for DirectedCsrGraph<NI, NV, ()>

Source§

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