Struct rs_graph::wrapped::WrappedBuilder
[−]
[src]
pub struct WrappedBuilder<G, B>(_, _)
where
G: WrappedGraph;
A builder for a wrapped graph.
Trait Implementations
impl<G, B> Builder for WrappedBuilder<G, B> where
G: WrappedGraph,
B: Builder<Graph = G::Graph>,
[src]
G: WrappedGraph,
B: Builder<Graph = G::Graph>,
type Graph = G
The graph type produced by this builder.
type Node = B::Node
The type of a nodes.
type Edge = B::Edge
The type of an edge.
fn new() -> Self
[src]
Create a new, empty builder.
fn with_capacities(nnodes: usize, nedges: usize) -> Self
[src]
Create a new, empty builder. Read more
fn reserve(&mut self, nnodes: usize, nedges: usize)
[src]
Reserve memory for a certain number of nodes and edges.
fn add_node(&mut self) -> Self::Node
[src]
Add a new node.
fn add_nodes(&mut self, n: usize) -> Vec<Self::Node>
[src]
Add n
new nodes.
fn add_edge(&mut self, u: Self::Node, v: Self::Node) -> Self::Edge
[src]
Add a new edge.
fn node2id(&self, u: Self::Node) -> usize
[src]
Return a unique id of a node.
fn edge2id(&self, e: Self::Edge) -> usize
[src]
Return a unique id of an edge.
fn to_graph(self) -> Self::Graph
[src]
Turn the builder into a graph.