[][src]Trait btree_graph::GetEdgeValue

pub trait GetEdgeValue<V, E> {
    pub fn get_edge_value(&self, x: E) -> Option<&(V, V)>;
}

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

pub fn get_edge_value(&self, x: E) -> Option<&(V, V)>[src]

Loading content...

Implementors

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

Loading content...