Trait petgraph::visit::Walker[][src]

pub trait Walker<Context> {
    type Item;
    fn walk_next(&mut self, context: Context) -> Option<Self::Item>;

    fn iter(self, context: Context) -> WalkerIter<Self, Context>

Notable traits for WalkerIter<W, C>

impl<W, C> Iterator for WalkerIter<W, C> where
    W: Walker<C>,
    C: Clone
type Item = W::Item;

    where
        Self: Sized,
        Context: Clone
, { ... } }

A walker is a traversal state, but where part of the traversal information is supplied manually to each next call.

This for example allows graph traversals that don’t hold a borrow of the graph they are traversing.

Associated Types

type Item[src]

Loading content...

Required methods

fn walk_next(&mut self, context: Context) -> Option<Self::Item>[src]

Advance to the next item

Loading content...

Provided methods

fn iter(self, context: Context) -> WalkerIter<Self, Context>

Notable traits for WalkerIter<W, C>

impl<W, C> Iterator for WalkerIter<W, C> where
    W: Walker<C>,
    C: Clone
type Item = W::Item;
where
    Self: Sized,
    Context: Clone
[src]

Create an iterator out of the walker and given context.

Loading content...

Implementations on Foreign Types

impl<'a, C, W: ?Sized> Walker<C> for &'a mut W where
    W: Walker<C>, 
[src]

type Item = W::Item

Loading content...

Implementors

impl<G> Walker<G> for Bfs<G::NodeId, G::Map> where
    G: IntoNeighbors + Visitable
[src]

type Item = G::NodeId

impl<G> Walker<G> for Dfs<G::NodeId, G::Map> where
    G: IntoNeighbors + Visitable
[src]

type Item = G::NodeId

impl<G> Walker<G> for DfsPostOrder<G::NodeId, G::Map> where
    G: IntoNeighbors + Visitable
[src]

type Item = G::NodeId

impl<G> Walker<G> for Topo<G::NodeId, G::Map> where
    G: IntoNeighborsDirected + Visitable
[src]

type Item = G::NodeId

Loading content...