Struct rs_graph::linkedlistgraph::LinkedListGraphBuilder[][src]

pub struct LinkedListGraphBuilder<ID, N, E> { /* fields omitted */ }

A builder for a LinkedListGraph.

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, N, E> Builder for LinkedListGraphBuilder<ID, N, E> where
    ID: PrimInt + Unsigned,
    N: Default,
    E: Default
[src]

type Graph = LinkedListGraph<ID, N, E>

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) -> LinkedListGraph<ID, N, E>[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, N, E> RefUnwindSafe for LinkedListGraphBuilder<ID, N, E> where
    E: RefUnwindSafe,
    ID: RefUnwindSafe,
    N: RefUnwindSafe

impl<ID, N, E> Send for LinkedListGraphBuilder<ID, N, E> where
    E: Send,
    ID: Send,
    N: Send

impl<ID, N, E> Sync for LinkedListGraphBuilder<ID, N, E> where
    E: Sync,
    ID: Sync,
    N: Sync

impl<ID, N, E> Unpin for LinkedListGraphBuilder<ID, N, E> where
    E: Unpin,
    ID: Unpin,
    N: Unpin

impl<ID, N, E> UnwindSafe for LinkedListGraphBuilder<ID, N, E> where
    E: UnwindSafe,
    ID: UnwindSafe,
    N: 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.