Trait rustc_ap_rustc_data_structures::graph::iterate::TriColorVisitor[][src]

pub trait TriColorVisitor<G: ?Sized> where
    G: DirectedGraph
{ type BreakVal; fn node_examined(
        &mut self,
        _node: G::Node,
        _prior_status: Option<NodeStatus>
    ) -> ControlFlow<Self::BreakVal> { ... }
fn node_settled(&mut self, _node: G::Node) -> ControlFlow<Self::BreakVal> { ... }
fn ignore_edge(&mut self, _source: G::Node, _target: G::Node) -> bool { ... } }

What to do when a node is examined or becomes Settled during DFS.

Associated Types

type BreakVal[src]

The value returned by this search.

Loading content...

Provided methods

fn node_examined(
    &mut self,
    _node: G::Node,
    _prior_status: Option<NodeStatus>
) -> ControlFlow<Self::BreakVal>
[src]

Called when a node is examined by the depth-first search.

By checking the value of prior_status, this visitor can determine whether the edge leading to this node was a tree edge (None), forward edge (Some(Settled)) or back edge (Some(Visited)). For a full explanation of each edge type, see the "Depth-first Search" chapter in CLR or wikipedia.

If you want to know both nodes linked by each edge, you'll need to modify TriColorDepthFirstSearch to store a source node for each Visited event.

fn node_settled(&mut self, _node: G::Node) -> ControlFlow<Self::BreakVal>[src]

Called after all nodes reachable from this one have been examined.

fn ignore_edge(&mut self, _source: G::Node, _target: G::Node) -> bool[src]

Behave as if no edges exist from source to target.

Loading content...

Implementors

impl<G: ?Sized> TriColorVisitor<G> for CycleDetector where
    G: DirectedGraph
[src]

type BreakVal = ()

Loading content...