pub trait GraphIterator<G: ?Sized>: Clone {
    type Item;

    // Required method
    fn next(&mut self, g: &G) -> Option<Self::Item>;

    // Provided methods
    fn size_hint(&self, _g: &G) -> (usize, Option<usize>) { ... }
    fn count(self, g: &G) -> usize { ... }
    fn iter(self, g: &G) -> GraphIter<'_, G, Self> 
       where G: Sized { ... }
}
Expand description

A graph iterator.

This is roughly the same interface as a standard iterator. However, all its method take additionally the graph itself as parameter. This allows the iterator to not contain a reference to internal graph data.

This might be useful for algorithms that need to store several iterators because they require less memory (they do not need to store a reference to the same graph, each!).

Required Associated Types§

Required Methods§

source

fn next(&mut self, g: &G) -> Option<Self::Item>

Provided Methods§

source

fn size_hint(&self, _g: &G) -> (usize, Option<usize>)

source

fn count(self, g: &G) -> usize

source

fn iter(self, g: &G) -> GraphIter<'_, G, Self> where G: Sized,

Implementors§

source§

impl<'a, A, I> GraphIterator<&'a A> for AdjacenciesWrapIt<I>where I: GraphIterator<A>,

§

type Item = <I as GraphIterator<A>>::Item

source§

impl<'a, G, I> GraphIterator<&'a G> for WrapIt<I>where I: GraphIterator<G>,

§

type Item = <I as GraphIterator<G>>::Item

source§

impl<'a, G, I> GraphIterator<Network<'a, G>> for NetworkEdgeIt<G, I>where I: GraphIterator<G>, I::Item: Clone,

source§

impl<'a, G, I> GraphIterator<Network<'a, G>> for NetworkNodeIt<I>where I: GraphIterator<G>,

§

type Item = <I as GraphIterator<G>>::Item

source§

impl<'a, G, I, N, D> GraphIterator<Network<'a, G>> for NetworkInIt<I>where I: GraphIterator<G, Item = (D, N)>, D: DirectedEdge,

§

type Item = (NetworkEdge<<D as DirectedEdge>::Edge>, N)

source§

impl<'a, G, I, N, D> GraphIterator<Network<'a, G>> for NetworkIncidentIt<I, I::Item>where I: GraphIterator<G, Item = (D, N)>, N: Clone, D: DirectedEdge + Clone,

source§

impl<'a, G, I, N, D> GraphIterator<Network<'a, G>> for NetworkOutIt<I>where I: GraphIterator<G, Item = (D, N)>, D: DirectedEdge,

§

type Item = (NetworkEdge<<D as DirectedEdge>::Edge>, N)

source§

impl<'a, G, I, N, E> GraphIterator<Network<'a, G>> for NetworkNeighIt<G, I>where N: Clone, E: Clone, I: GraphIterator<G, Item = (E, N)>,

§

type Item = (NetworkEdge<E>, N)

source§

impl<'a, ID> GraphIterator<VecGraph<ID>> for rs_graph::vecgraph::EdgeIt<ID>where ID: 'a + PrimInt + Unsigned,

§

type Item = Edge<ID>

source§

impl<'a, ID> GraphIterator<VecGraph<ID>> for rs_graph::vecgraph::NeighIt<'a, ID>where ID: PrimInt + Unsigned,

§

type Item = (Edge<ID>, Node<ID>)

source§

impl<'a, ID> GraphIterator<VecGraph<ID>> for rs_graph::vecgraph::NodeIt<ID>where ID: 'a + PrimInt + Unsigned,

§

type Item = Node<ID>

source§

impl<'g, G, I> GraphIterator<InEdges<'g, G>> for AdjacenciesWrapIt<I>where I: GraphIterator<G>,

§

type Item = <I as GraphIterator<G>>::Item

source§

impl<'g, G, I> GraphIterator<Neighbors<'g, G>> for AdjacenciesWrapIt<I>where I: GraphIterator<G>,

§

type Item = <I as GraphIterator<G>>::Item

source§

impl<'g, G, I> GraphIterator<OutEdges<'g, G>> for AdjacenciesWrapIt<I>where I: GraphIterator<G>,

§

type Item = <I as GraphIterator<G>>::Item

source§

impl<A, P, I> GraphIterator<FilterAdjacencies<A, P>> for Filtered<I>where I: GraphIterator<A>, P: for<'r> Fn(&'r I::Item) -> bool,

§

type Item = <I as GraphIterator<A>>::Item

source§

impl<G, I> GraphIterator<Rc<G, Global>> for WrapIt<I>where I: GraphIterator<G>,

§

type Item = <I as GraphIterator<G>>::Item

source§

impl<G, I> GraphIterator<NonNull<G>> for WrapIt<I>where I: GraphIterator<G>,

§

type Item = <I as GraphIterator<G>>::Item

source§

impl<ID, N, E> GraphIterator<LinkedListGraph<ID, N, E>> for rs_graph::linkedlistgraph::EdgeIt<ID>where ID: PrimInt + Unsigned,

§

type Item = Edge<ID>

source§

impl<ID, N, E> GraphIterator<LinkedListGraph<ID, N, E>> for rs_graph::linkedlistgraph::NeighIt<ID>where ID: PrimInt + Unsigned,

§

type Item = (Edge<ID>, Node<ID>)

source§

impl<ID, N, E> GraphIterator<LinkedListGraph<ID, N, E>> for rs_graph::linkedlistgraph::NodeIt<ID>where ID: PrimInt + Unsigned,

§

type Item = Node<ID>

source§

impl<ID, N, E> GraphIterator<LinkedListGraph<ID, N, E>> for OutIt<ID>where ID: PrimInt + Unsigned,

§

type Item = (Edge<ID>, Node<ID>)

source§

impl<N, E, Ne, NeIt> GraphIterator<FnAdj<N, E, Ne, NeIt>> for FnNeighIt<NeIt>where NeIt: Iterator<Item = (E, N)> + Clone,

§

type Item = (E, N)