Struct rs_graph::vecgraph::VecGraphBuilder[][src]

pub struct VecGraphBuilder<ID> { /* fields omitted */ }

A builder for a VecGraph.

The basic task is to arrange the final outgoing and incoming edges in the linked lists appropriately (i.e. first outgoing, then incoming edges).

Trait Implementations

impl<ID> Builder for VecGraphBuilder<ID> where
    ID: PrimInt + Unsigned
[src]

type Graph = VecGraph<ID>

The graph type produced by this builder.

type Node = Node<ID>

The type of a nodes.

type Edge = Edge<ID>

The type of an edge.

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 num_nodes(&self) -> usize[src]

Return the current number of nodes.

fn num_edges(&self) -> usize[src]

Return the current number of nodes.

fn add_node(&mut self) -> Self::Node[src]

Add a new node.

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 into_graph(self) -> VecGraph<ID>[src]

Turn the builder into a graph.

fn new() -> Self[src]

Create a new, empty builder.

fn add_nodes(&mut self, n: usize) -> Vec<Self::Node>[src]

Add n new nodes.

Auto Trait Implementations

impl<ID> RefUnwindSafe for VecGraphBuilder<ID> where
    ID: RefUnwindSafe

impl<ID> Send for VecGraphBuilder<ID> where
    ID: Send

impl<ID> Sync for VecGraphBuilder<ID> where
    ID: Sync

impl<ID> Unpin for VecGraphBuilder<ID> where
    ID: Unpin

impl<ID> UnwindSafe for VecGraphBuilder<ID> where
    ID: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.