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

Returns the total amount of nodes this graph holds

Creates a new edge with given data without any edges

Creates a new edge between a and b with given edge data

Provided Methods

Convenience function, implemented in terms of Graph::add_node and Graph::add_edge

Implementors