Struct petgraph::visit::DfsPostOrder  
source · [−]pub struct DfsPostOrder<N, VM> {
    pub stack: Vec<N>,
    pub discovered: VM,
    pub finished: VM,
}Expand description
Visit nodes in a depth-first-search (DFS) emitting nodes in postorder (each node after all its descendants have been emitted).
DfsPostOrder is not recursive.
The traversal starts at a given node and only traverses nodes reachable from it.
Fields
stack: Vec<N>The stack of nodes to visit
discovered: VMThe map of discovered nodes
finished: VMThe map of finished nodes
Implementations
sourceimpl<N, VM> DfsPostOrder<N, VM> where
    N: Copy + PartialEq,
    VM: VisitMap<N>, 
 
impl<N, VM> DfsPostOrder<N, VM> where
    N: Copy + PartialEq,
    VM: VisitMap<N>, 
sourcepub fn new<G>(graph: G, start: N) -> Self where
    G: GraphRef + Visitable<NodeId = N, Map = VM>, 
 
pub fn new<G>(graph: G, start: N) -> Self where
    G: GraphRef + Visitable<NodeId = N, Map = VM>, 
Create a new DfsPostOrder using the graph’s visitor map, and put
start in the stack of nodes to visit.
sourcepub fn empty<G>(graph: G) -> Self where
    G: GraphRef + Visitable<NodeId = N, Map = VM>, 
 
pub fn empty<G>(graph: G) -> Self where
    G: GraphRef + Visitable<NodeId = N, Map = VM>, 
Create a new DfsPostOrder using the graph’s visitor map, and no stack.
sourcepub fn reset<G>(&mut self, graph: G) where
    G: GraphRef + Visitable<NodeId = N, Map = VM>, 
 
pub fn reset<G>(&mut self, graph: G) where
    G: GraphRef + Visitable<NodeId = N, Map = VM>, 
Clear the visit state
sourcepub fn move_to(&mut self, start: N)
 
pub fn move_to(&mut self, start: N)
Keep the discovered and finished map, but clear the visit stack and restart the dfs from a particular node.
sourcepub fn next<G>(&mut self, graph: G) -> Option<N> where
    G: IntoNeighbors<NodeId = N>, 
 
pub fn next<G>(&mut self, graph: G) -> Option<N> where
    G: IntoNeighbors<NodeId = N>, 
Return the next node in the traversal, or None if the traversal is done.
Trait Implementations
sourceimpl<N: Clone, VM: Clone> Clone for DfsPostOrder<N, VM>
 
impl<N: Clone, VM: Clone> Clone for DfsPostOrder<N, VM>
sourcefn clone(&self) -> DfsPostOrder<N, VM>
 
fn clone(&self) -> DfsPostOrder<N, VM>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<N: Debug, VM: Debug> Debug for DfsPostOrder<N, VM>
 
impl<N: Debug, VM: Debug> Debug for DfsPostOrder<N, VM>
sourceimpl<N, VM> Default for DfsPostOrder<N, VM> where
    VM: Default, 
 
impl<N, VM> Default for DfsPostOrder<N, VM> where
    VM: Default, 
sourceimpl<G> Walker<G> for DfsPostOrder<G::NodeId, G::Map> where
    G: IntoNeighbors + Visitable, 
 
impl<G> Walker<G> for DfsPostOrder<G::NodeId, G::Map> where
    G: IntoNeighbors + Visitable, 
type Item = G::NodeId
sourcefn 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, 
 
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, 
W: Walker<C>,
C: Clone, type Item = W::Item;
Create an iterator out of the walker and given context.
Auto Trait Implementations
impl<N, VM> RefUnwindSafe for DfsPostOrder<N, VM> where
    N: RefUnwindSafe,
    VM: RefUnwindSafe, 
impl<N, VM> Send for DfsPostOrder<N, VM> where
    N: Send,
    VM: Send, 
impl<N, VM> Sync for DfsPostOrder<N, VM> where
    N: Sync,
    VM: Sync, 
impl<N, VM> Unpin for DfsPostOrder<N, VM> where
    N: Unpin,
    VM: Unpin, 
impl<N, VM> UnwindSafe for DfsPostOrder<N, VM> where
    N: UnwindSafe,
    VM: UnwindSafe, 
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
    T: ?Sized, 
 
impl<T> BorrowMut<T> for T where
    T: ?Sized, 
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
    T: Clone, 
 
impl<T> ToOwned for T where
    T: Clone, 
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
 
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more