Enables traversing through a network of connected nodes.
Checking if a path is valid and setting new paths.
Calculates the path from node A to node B.
use pathfinder::{Coordinate, Network, Node};
let nodes = Node::from_list(&[(0, 0), (10, 10), (20, 20), (30, 30)]);
let mut nodes = Node::linked_list(nodes);
let path = Network::new(nodes).path("A", "D").unwrap();
assert_eq!(path.len(), 4);
Mimics path behaviour but works in reverse, Meaning stepping back in
the links.
Returns if the given hash exists in the network.
use pathfinder::{Coordinate, Network, Node};
let nodes = Node::from_list(&[(0, 0), (10, 10), (20, 20), (30, 30), (40, 40)]);
let network = Network::new(nodes.clone());
assert!(network.get("A").is_some());
assert!(network.get("E").is_some());
assert!(network.get("F").is_none());
Performs copy-assignment from source
. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Sets value
as a parameter of self
.