pub struct LinkedListGraphBuilder<ID, N, E> { /* private fields */ }
Expand description

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§

source§

impl<ID, N, E> Builder for LinkedListGraphBuilder<ID, N, E>where ID: PrimInt + Unsigned + 'static, N: Default, E: Default,

§

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.
source§

fn with_capacities(nnodes: usize, nedges: usize) -> Self

Create a new, empty builder. Read more
source§

fn reserve(&mut self, nnodes: usize, nedges: usize)

Reserve memory for a certain number of nodes and edges.
source§

fn num_nodes(&self) -> usize

Return the current number of nodes.
source§

fn num_edges(&self) -> usize

Return the current number of nodes.
source§

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

Add a new node.
source§

fn add_edge(&mut self, u: Self::Node, v: Self::Node) -> Self::Edge

Add a new edge.
source§

fn node2id(&self, u: Self::Node) -> usize

Return a unique id of a node.
source§

fn edge2id(&self, e: Self::Edge) -> usize

Return a unique id of an edge.
source§

fn id2node(&self, uid: usize) -> Self::Node

Return the node with a certain id.
source§

fn id2edge(&self, eid: usize) -> Self::Edge

Return the edge with a certain id.
source§

fn into_graph(self) -> LinkedListGraph<ID, N, E>

Turn the builder into a graph.
source§

fn new() -> Self

Create a new, empty builder.
source§

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

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§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.