Struct rs_graph::attributed::AttributedBuilder
[−]
[src]
pub struct AttributedBuilder<B, Gx, Nx, Ex, Ax>(_, _);
Default builder for an attributes graph.
This builder requires the attributes to be default constructable. All attributes will be initialized with these default values.
Trait Implementations
impl<'b, B, G, Gx, Nx, Ex, Ax> Builder for AttributedBuilder<B, Gx, Nx, Ex, Ax> where
B: Builder<Graph = G>,
G: Graph<'b>,
Gx: Default,
Nx: Default,
Ex: Default,
Ax: Default,
[src]
B: Builder<Graph = G>,
G: Graph<'b>,
Gx: Default,
Nx: Default,
Ex: Default,
Ax: Default,
type Graph = Attributed<G, Gx, Nx, Ex, Ax>
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 with_capacities(nnodes: usize, nedges: usize) -> Self
Create a new, empty builder. Read more
fn reserve(&mut self, nnodes: usize, nedges: usize)
Reserve memory for a certain number of nodes and edges.
fn add_node(&mut self) -> Self::Node
Add a new node.
fn add_nodes(&mut self, n: usize) -> Vec<Self::Node>
Add n
new nodes.
fn add_edge(&mut self, u: Self::Node, v: Self::Node) -> Self::Edge
Add a new edge.
fn node_id(&self, u: Self::Node) -> usize
Return a unique id of a node.
fn edge_id(&self, e: Self::Edge) -> usize
Return a unique id of an edge.
fn to_graph(self) -> Attributed<G, Gx, Nx, Ex, Ax>
Turn the builder into a graph.
fn new() -> Self
Create a new, empty builder.