Trait eiffelvis_core::graph::Graph
source · [−]pub trait Graph: Meta + ItemIter + Indexable<<Self as Meta>::Idx> + Indexable<<Self as Meta>::Key> {
fn node_count(&self) -> usize;
fn add_node(&mut self, key: Self::Key, data: Self::Data) -> Option<Self::Idx>;
fn add_edge(&mut self, a: Self::Key, b: Self::Key, data: Self::EdgeData);
fn add_node_with_edges<I>(
&mut self,
key: Self::Key,
data: Self::Data,
edges: I
) -> Option<Self::Idx>
where
I: Iterator<Item = (Self::Key, Self::EdgeData)>,
{ ... }
}
Expand description
Main graph trait
Required Methods
sourcefn node_count(&self) -> usize
fn node_count(&self) -> usize
Returns the total amount of nodes this graph holds
Creates a new edge with given data without any edges
Provided Methods
Convenience function, implemented in terms of Graph::add_node and Graph::add_edge