Struct wuf::Graph

source ·
pub struct Graph { /* private fields */ }

Implementations§

Returns a new Graph with the given number of nodes.

Arguments
  • n Number of nodes belonging to the graph.

Returns the number of nodes.

Example
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.

Arguments
  • a ID of the first node.
  • b ID of the second node.
Example
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.

Arguments
  • a ID of the first node.
  • b ID of the second node.
Example
let mut graph = wuf::Graph::new(10);
let node1 = 0;
let node2 = 1;
graph.connect(node1, node2);

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
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.