[][src]Trait generic_graph::VariableEdges

pub trait VariableEdges<T, E, K, V, W, C>: DirectedGraph<T, E, K, V, W, C> where
    K: Hash + Eq + Clone,
    C: Hash + Eq + Clone,
    W: Sum + Sub + Eq + Ord + Copy,
    T: Vertex<K, V>,
    E: Edge<K, W, C>, 
{ fn add_edge(&mut self, edge: E) -> Option<E>;
fn remove_edge(&mut self, pair: (&K, &K)) -> Option<E>; }

This trait adds to a Directed graph the methods to add and remove edges

Required methods

fn add_edge(&mut self, edge: E) -> Option<E>

If an edge with an equal key is already present, the edge is updated (not the key) and the old edge is returned ad Some(old_edge). If not present None is returned.

fn remove_edge(&mut self, pair: (&K, &K)) -> Option<E>

If the removed edge was present it's removed and returned as Some(edge). Otherwise None is returned

Loading content...

Implementors

Loading content...