pub struct Graph { /* private fields */ }
Returns a new Graph with the given number of nodes.
n
Number of nodes belonging to the graph.
Returns the number of nodes.
let graph = wuf::Graph::new(10);
println!("Number of nodes: {}", graph.count());
Returns true only if the two given nodes are connected,
otherwise returns false.
a
ID of the first node.
b
ID of the second node.
let mut graph = wuf::Graph::new(10);
let node1 = 0;
let node2 = 1;
println!("Are nodes connected? {}", graph.connected(node1, node2));
Connects the two given nodes.
a
ID of the first node.
b
ID of the second node.
let mut graph = wuf::Graph::new(10);
let node1 = 0;
let node2 = 1;
graph.connect(node1, node2);
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.