[][src]Trait btree_network::GetVertexValue

pub trait GetVertexValue<T> where
    T: Ord
{ pub fn get_vertex_value(&self, x: T) -> Option<&BTreeSet<T>>; }

GetVertexValue returns the value associated with the vertex x.

Example

extern crate alloc;
use alloc::collections::btree_set::BTreeSet;
use btree_network::{BTreeNetwork, AddVertex, AddEdge, GetVertexValue};
let mut network: BTreeNetwork<String> = BTreeNetwork::new();
network.add_vertex(String::from("origin"));
network.add_vertex(String::from("destination"));
network.add_edge(String::from("origin"), String::from("destination"));

let vertex_value: &BTreeSet<String> = network.get_vertex_value(String::from("origin")).unwrap();
assert!(vertex_value.contains(&String::from("destination")));

Required methods

pub fn get_vertex_value(&self, x: T) -> Option<&BTreeSet<T>>[src]

Loading content...

Implementors

impl<T> GetVertexValue<T> for BTreeNetwork<T> where
    T: Ord
[src]

Loading content...