[][src]Trait generic_graph::VariableVertexes

pub trait VariableVertexes<T, E, K, V, W, C>: DirectedGraph<T, E, K, V, W, C> where
    K: Hash + Eq + Clone,
    C: Hash + Eq + Clone,
    W: Add + Sub + Eq + Ord + Copy,
    T: Vertex<K, V>,
    E: Edge<K, W, C>, 
{ fn add_vertex(&mut self, vertex: T) -> Option<T>;
fn remove_vertex(&mut self, key: K) -> Option<T>; }

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

Required methods

fn add_vertex(&mut self, vertex: T) -> Option<T>

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

fn remove_vertex(&mut self, key: K) -> Option<T>

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

Loading content...

Implementors

Loading content...