pub trait Visitor {
type Hasher: Hasher;
// Required methods
fn visit<N>(&mut self, node: &N) -> bool
where N: Identifiable;
fn clear(&mut self);
fn hasher(&self) -> Self::Hasher;
// Provided methods
fn touch<N>(&mut self, _node: &N, _operation: Option<&'static str>)
where N: Identifiable { ... }
fn notify_recalculated<N>(&mut self, _node: &N)
where N: Identifiable { ... }
fn touch_dependency_group(&mut self, _dep: &'static str) { ... }
fn leave<N>(&mut self, _node: &N)
where N: Identifiable { ... }
}Expand description
A collection passed in to a graph, tracking the identifiers of each nodes to avoid traversing
Required Associated Types§
Required Methods§
sourcefn visit<N>(&mut self, node: &N) -> boolwhere
N: Identifiable,
fn visit<N>(&mut self, node: &N) -> boolwhere N: Identifiable,
Return true iff this node hasn’t been visited yet.
sourcefn clear(&mut self)
fn clear(&mut self)
Clear the internal collection, prompting this visitor to revisit all nodes on the next traversal.
fn hasher(&self) -> Self::Hasher
Provided Methods§
sourcefn touch<N>(&mut self, _node: &N, _operation: Option<&'static str>)where
N: Identifiable,
fn touch<N>(&mut self, _node: &N, _operation: Option<&'static str>)where N: Identifiable,
Touch the node. Useful for building graph visualisations.
sourcefn notify_recalculated<N>(&mut self, _node: &N)where
N: Identifiable,
fn notify_recalculated<N>(&mut self, _node: &N)where N: Identifiable,
For diagnostics, notify that a node has been recalculated.
sourcefn touch_dependency_group(&mut self, _dep: &'static str)
fn touch_dependency_group(&mut self, _dep: &'static str)
Touch a dependency group type. Useful for building graph visualisations.
sourcefn leave<N>(&mut self, _node: &N)where
N: Identifiable,
fn leave<N>(&mut self, _node: &N)where N: Identifiable,
Undo a touch. Useful for building graph visualisations.
Implementations on Foreign Types§
Implementors§
source§impl Visitor for GraphvizVisitor
Available on crate feature graphviz only.
impl Visitor for GraphvizVisitor
Available on crate feature
graphviz only.