[][src]Trait btree_network::Connections

pub trait Connections<T> {
    pub fn connections(&self, x: T) -> Option<&BTreeSet<T>>;
}

Connections lists all vertices y such that there is an edge from the vertex x to the vertex y. An error is thrown if x does not exist.

Example

use btree_network::{BTreeNetwork, AddVertex, AddEdge, Connections};
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"));

assert!(network.connections(String::from("origin")).unwrap().contains(&String::from("destination")));

Required methods

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

Loading content...

Implementors

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

Loading content...