Trait Undirected

Source
pub trait Undirected: GraphType {
    type NeighIt<'a>: GraphIterator<Self, Item = (Self::Edge<'a>, Self::Node<'a>)>
       where Self: 'a;

    // Required method
    fn neigh_iter(&self, u: Self::Node<'_>) -> Self::NeighIt<'_>;

    // Provided methods
    fn neighs(
        &self,
        u: Self::Node<'_>,
    ) -> GraphIter<'_, Self, <Self as Undirected>::NeighIt<'_>> 
       where Self: Sized { ... }
    fn neighbors(&self) -> Neighbors<'_, Self>
       where Self: Sized { ... }
}
Expand description

A graph with list access to undirected incident edges.

Required Associated Types§

Source

type NeighIt<'a>: GraphIterator<Self, Item = (Self::Edge<'a>, Self::Node<'a>)> where Self: 'a

Type of a graph iterator over all incident edges.

Required Methods§

Source

fn neigh_iter(&self, u: Self::Node<'_>) -> Self::NeighIt<'_>

Return a graph iterator over the edges adjacent to some node.

Provided Methods§

Source

fn neighs( &self, u: Self::Node<'_>, ) -> GraphIter<'_, Self, <Self as Undirected>::NeighIt<'_>>
where Self: Sized,

Return an iterator over the edges adjacent to some node.

Source

fn neighbors(&self) -> Neighbors<'_, Self>
where Self: Sized,

Return access to the neighbors via an Adjacencies trait.

This is the same as calling Neighbors(&g) on the graph.

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<'g, G> Undirected for &'g G
where G: Undirected,

Source§

type NeighIt<'a> = WrapIt<<G as Undirected>::NeighIt<'a>> where G: 'a, 'g: 'a

Source§

fn neigh_iter(&self, u: Self::Node<'_>) -> Self::NeighIt<'_>

Source§

impl<G> Undirected for Rc<G>
where G: Undirected,

Source§

type NeighIt<'a> = WrapIt<<G as Undirected>::NeighIt<'a>> where G: 'a

Source§

fn neigh_iter(&self, u: Self::Node<'_>) -> Self::NeighIt<'_>

Implementors§

Source§

impl<'g, G> Undirected for Network<'g, G>
where G: Undirected,

Source§

type NeighIt<'a> = NetworkNeighIt<G, <G as Undirected>::NeighIt<'a>> where G: 'a, 'g: 'a

Source§

impl<'g, G> Undirected for ReverseDigraph<'g, G>
where G: Undirected,

Source§

type NeighIt<'a> = ReverseWrapIt<<G as Undirected>::NeighIt<'a>> where G: 'a, 'g: 'a

Source§

impl<ID> Undirected for VecGraph<ID>
where ID: PrimInt + Unsigned + 'static,

Source§

type NeighIt<'a> = NeighIt<'a, ID>

Source§

impl<ID, N, E> Undirected for LinkedListGraph<ID, N, E>
where ID: PrimInt + Unsigned + 'static,

Source§

type NeighIt<'a> = NeighIt<ID> where N: 'a, E: 'a