GetEdgeValue

Trait GetEdgeValue 

Source
pub trait GetEdgeValue<V, E> {
    // Required method
    fn get_edge_value(&self, x: E) -> Option<&(V, V)>;
}
Expand description

GetEdgeValue returns the value associated with the edge (x, y).

§Example

use btree_graph::{BTreeGraph, AddVertex, AddEdge, GetEdgeValue};
let mut graph: BTreeGraph<String, usize> = BTreeGraph::new();
graph.add_vertex(String::from("origin"));
graph.add_vertex(String::from("destination"));
graph.add_edge(String::from("origin"), String::from("destination"), 10);

let edge_value: &(String, String) = graph.get_edge_value(10).unwrap();
assert_eq!(edge_value.0, String::from("origin"));
assert_eq!(edge_value.1, String::from("destination"));

Required Methods§

Source

fn get_edge_value(&self, x: E) -> Option<&(V, V)>

Implementors§

Source§

impl<V, E> GetEdgeValue<V, E> for BTreeGraph<V, E>
where V: Ord, E: Ord,