[−][src]Trait btree_dag::AddEdge
AddEdge
add an edge from the vertex x to the vertex y, if it is not there.
Example
extern crate alloc; use alloc::collections::btree_set::BTreeSet; use btree_dag::{BTreeDag, AddVertex, AddEdge, GetVertexValue}; use btree_dag::error::Error; let mut dag: BTreeDag<String> = BTreeDag::new(); dag.add_vertex(String::from("origin")); dag.add_vertex(String::from("destination")); dag.add_edge(String::from("origin"), String::from("destination")); let x_value: &BTreeSet<String> = dag.get_vertex_value(String::from("origin")).unwrap(); assert!(x_value.contains(&String::from("destination"))); assert!(dag.get_vertex_value(String::from("destination")).unwrap().is_empty());
Associated Types
Loading content...Required methods
Loading content...Implementors
impl<T> AddEdge<T> for BTreeDag<T> where
T: Ord + Clone,
[src]
T: Ord + Clone,
When you add an edge, you should make sure that the x, and y vertices exist.