Struct pathfinder::Network [−][src]
Fields
hash_map: [Option<T>; 666]
Methods
impl<T: Draw + Hash + Copy> Network<T>
[src]
impl<T: Draw + Hash + Copy> Network<T>
impl Network<Node>
[src]
impl Network<Node>
pub fn path<'a>(
&'a self,
a: &str,
b: &str,
algorithm: &Fn(&Network<Node>, &str, &str) -> Vec<Node>
) -> Vec<Node>
[src]
pub fn path<'a>(
&'a self,
a: &str,
b: &str,
algorithm: &Fn(&Network<Node>, &str, &str) -> Vec<Node>
) -> Vec<Node>
Calculates the path from node A to node B.
use pathfinder::{Node, Coordinate, Network}; let b = Node::new("B", Coordinate::new(20,20)); let mut a = Node::new("A", Coordinate::new(0,0)); a.link(&b); let network = Network::new(vec!(a, b)); let path = network.path("A", "B", &Network::path_shortest_leg); assert_eq!(path, vec!(a, b));
pub fn get(&self, element: &str) -> Option<Node>
[src]
pub fn get(&self, element: &str) -> Option<Node>
Returns if the given hash exists in the network.
pub fn path_shortest_leg<'a>(
network: &'a Network<Node>,
a: &str,
b: &str
) -> Vec<Node>
[src]
pub fn path_shortest_leg<'a>(
network: &'a Network<Node>,
a: &str,
b: &str
) -> Vec<Node>
Trait Implementations
impl<T: Clone + Draw + Hash + Copy> Clone for Network<T>
[src]
impl<T: Clone + Draw + Hash + Copy> Clone for Network<T>
fn clone(&self) -> Network<T>
[src]
fn clone(&self) -> Network<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<T: Copy + Draw + Hash + Copy> Copy for Network<T>
[src]
impl<T: Copy + Draw + Hash + Copy> Copy for Network<T>