pub trait TCNode<K> {
// Required methods
fn get_key(&self) -> K;
fn add_edge_to(&mut self, k: K);
fn out_edges(&self) -> Box<dyn Iterator<Item = &K> + '_>;
fn has_edge_to(&self, k: &K) -> bool;
fn reset_edges(&mut self);
// Provided method
fn direct_edges(&self) -> Box<dyn Iterator<Item = &K> + '_> { ... }
}Expand description
Trait used to generalize transitive closure computation. This trait should
be implemented for types representing a node in the hierarchy (e.g., the
entity hierarchy) where we need to compute the transitive closure of the
hierarchy starting from only direct adjacencies. This trait is parametrized
by a type K which represents a unique identifier for graph nodes.
Required Methods§
Sourcefn add_edge_to(&mut self, k: K)
fn add_edge_to(&mut self, k: K)
Add an edge out off this node to the node with key k.
Sourcefn out_edges(&self) -> Box<dyn Iterator<Item = &K> + '_>
fn out_edges(&self) -> Box<dyn Iterator<Item = &K> + '_>
Retrieve an iterator for the edges out of this node.
Sourcefn has_edge_to(&self, k: &K) -> bool
fn has_edge_to(&self, k: &K) -> bool
Return true when their is an edge between this node and the node with
key k.
Sourcefn reset_edges(&mut self)
fn reset_edges(&mut self)
Resets edges to base
Provided Methods§
Sourcefn direct_edges(&self) -> Box<dyn Iterator<Item = &K> + '_>
fn direct_edges(&self) -> Box<dyn Iterator<Item = &K> + '_>
Retrieves an iterator for direct edges out of this node.