Trait rs_graph::traits::GraphIterator[][src]

pub trait GraphIterator<G: ?Sized>: Clone {
    type Item;
    fn next(&mut self, g: &G) -> Option<Self::Item>;

    fn size_hint(&self, _g: &G) -> (usize, Option<usize>) { ... }
fn count(self, g: &G) -> usize { ... }
fn iter<'a>(self, g: &'a G) -> GraphIter<'a, G, Self>

Notable traits for GraphIter<'a, G, I>

impl<'a, G, I> Iterator for GraphIter<'a, G, I> where
    I: GraphIterator<G>, 
type Item = I::Item;

    where
        G: Sized
, { ... } }

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!).

Associated Types

Loading content...

Required methods

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

Loading content...

Provided methods

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

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

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

Notable traits for GraphIter<'a, G, I>

impl<'a, G, I> Iterator for GraphIter<'a, G, I> where
    I: GraphIterator<G>, 
type Item = I::Item;
where
    G: Sized
[src]

Loading content...

Implementors

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

type Item = I::Item

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

type Item = I::Item

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

type Item = NetworkEdge<I::Item>

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

type Item = I::Item

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

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

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
[src]

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

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

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

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)>, 
[src]

type Item = (NetworkEdge<E>, N)

impl<'a, G, P> GraphIterator<FilteredGraph<'a, G, P>> for FilterEdgeIt<G::EdgeIt> where
    G: GraphSize<'a>,
    P: for<'r> Fn(&'r G::Edge) -> bool
[src]

type Item = G::Edge

impl<'a, G, P, I> GraphIterator<FilteredGraph<'a, G, P>> for FilterWrapIt<I> where
    G: GraphType<'a>,
    P: for<'r> Fn(&'r G::Edge) -> bool,
    I: GraphIterator<G>, 
[src]

type Item = I::Item

impl<'a, G, P, I> GraphIterator<FilteredGraph<'a, G, P>> for rs_graph::filtered::Filtered<I> where
    G: GraphType<'a>,
    P: for<'r> Fn(&'r G::Edge) -> bool,
    I: GraphIterator<G, Item = (G::Edge, G::Node)>, 
[src]

type Item = I::Item

impl<'a, G, P, I> GraphIterator<FilteredGraph<'a, G, P>> for FilteredIncidentIt<I> where
    G: Directed<'a>,
    P: for<'r> Fn(&'r G::Edge) -> bool,
    I: GraphIterator<G, Item = (G::DirectedEdge, G::Node)>, 
[src]

type Item = I::Item

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

type Item = Edge<ID>

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

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

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

type Item = Node<ID>

impl<'a, ID, N, E> GraphIterator<LinkedListGraph<ID, N, E>> for rs_graph::linkedlistgraph::NeighIt<ID> where
    ID: 'a + PrimInt + Unsigned
[src]

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

impl<'a, ID, N, E> GraphIterator<LinkedListGraph<ID, N, E>> for OutIt<ID> where
    ID: 'a + PrimInt + Unsigned
[src]

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

impl<'a, ID, N: 'a, E: 'a> GraphIterator<LinkedListGraph<ID, N, E>> for rs_graph::linkedlistgraph::EdgeIt<ID> where
    ID: 'a + PrimInt + Unsigned
[src]

type Item = Edge<ID>

impl<'a, ID, N: 'a, E: 'a> GraphIterator<LinkedListGraph<ID, N, E>> for rs_graph::linkedlistgraph::NodeIt<ID> where
    ID: 'a + PrimInt + Unsigned
[src]

type Item = Node<ID>

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

type Item = I::Item

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

type Item = I::Item

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

type Item = I::Item

impl<'g, G, I> GraphIterator<EdgeIndexer<'g, G>> for IndexerIt<I> where
    I: GraphIterator<G>, 
[src]

type Item = I::Item

impl<'g, G, I> GraphIterator<NodeIndexer<'g, G>> for IndexerIt<I> where
    I: GraphIterator<G>, 
[src]

type Item = I::Item

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

type Item = I::Item

impl<G, Gx, Nx, Ex, I> GraphIterator<Attributed<G, Gx, Nx, Ex>> for AttributedWrapIt<I> where
    I: GraphIterator<G>, 
[src]

type Item = I::Item

Loading content...