Struct rs_graph::vecgraph::VecGraph[][src]

pub struct VecGraph<ID = u32> { /* fields omitted */ }

A vector based graph data structure.

Implementations

impl<ID> VecGraph<ID> where
    ID: PrimInt + Unsigned
[src]

pub fn new() -> VecGraph<ID>[src]

Trait Implementations

impl<ID> Buildable for VecGraph<ID> where
    ID: PrimInt + Unsigned
[src]

type Builder = VecGraphBuilder<ID>

fn new_builder() -> Self::Builder[src]

Create a new builder for this graph type.

fn new_with<F>(f: F) -> Self where
    F: FnOnce(&mut Self::Builder), 
[src]

Create a new graph by passing the builder to the callback f. Read more

impl<ID> Default for VecGraph<ID> where
    ID: PrimInt + Unsigned
[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl<'de, ID> Deserialize<'de> for VecGraph<ID> where
    ID: Deserialize<'de>, 
[src]

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl<'a, ID> Directed<'a> for VecGraph<ID> where
    ID: 'a + PrimInt + Unsigned
[src]

type OutIt = NeighIt<'a, ID>

Type of a graph iterator over edges leaving a node.

type InIt = NeighIt<'a, ID>

Type of a graph iterator over edges entering a node.

type IncidentIt = NeighIt<'a, ID>

Type of an iterator over all incident edges.

type DirectedEdge = Self::Edge

Type of a directed edge.

fn src(&self, e: Self::Edge) -> Self::Node[src]

Return the source node of an edge.

fn snk(&self, e: Self::Edge) -> Self::Node[src]

Return the sink node of an edge.

fn out_iter(&'a self, u: Self::Node) -> Self::OutIt[src]

Return a graph iterator over the edges leaving a node.

fn in_iter(&'a self, u: Self::Node) -> Self::InIt[src]

Return a graph iterator over the edges leaving a node.

fn incident_iter(&'a self, u: Self::Node) -> Self::IncidentIt[src]

Return an iterator over all directed edges incident with a node.

fn outedges(&'a self, u: Self::Node) -> GraphIter<'a, Self, Self::OutIt>

Notable traits for GraphIter<'a, G, I>

impl<'a, G, I> Iterator for GraphIter<'a, G, I> where
    I: GraphIterator<G>, 
type Item = I::Item;
where
    Self: Sized
[src]

Return an iterator over the edges leaving a node.

fn outgoing(&'a self) -> OutEdges<'a, Self> where
    Self: Sized
[src]

Return access to the outgoing arcs via an Adjacencies trait. Read more

fn inedges(&'a self, u: Self::Node) -> GraphIter<'a, Self, Self::InIt>

Notable traits for GraphIter<'a, G, I>

impl<'a, G, I> Iterator for GraphIter<'a, G, I> where
    I: GraphIterator<G>, 
type Item = I::Item;
where
    Self: Sized
[src]

Return an iterator over the edges leaving a node.

fn incoming(&'a self) -> InEdges<'a, Self> where
    Self: Sized
[src]

Return access to the incoming arcs via an Adjacencies trait. Read more

fn incident_edges(
    &'a self,
    u: Self::Node
) -> GraphIter<'a, Self, Self::IncidentIt>

Notable traits for GraphIter<'a, G, I>

impl<'a, G, I> Iterator for GraphIter<'a, G, I> where
    I: GraphIterator<G>, 
type Item = I::Item;
where
    Self: Sized
[src]

Return an iterator over all directed edges incident with a node.

impl<'a, ID> GraphIterator<VecGraph<ID>> for NodeIt<ID> where
    ID: 'a + PrimInt + Unsigned
[src]

type Item = Node<ID>

fn next(&mut self, _g: &VecGraph<ID>) -> Option<Self::Item>[src]

fn size_hint(&self, _g: &VecGraph<ID>) -> (usize, Option<usize>)[src]

fn count(self, _g: &VecGraph<ID>) -> usize[src]

fn iter<'a>(self, g: &'a G) -> GraphIter<'a, G, Self>

Notable traits for GraphIter<'a, G, I>

impl<'a, G, I> Iterator for GraphIter<'a, G, I> where
    I: GraphIterator<G>, 
type Item = I::Item;
where
    G: Sized
[src]

impl<'a, ID> GraphIterator<VecGraph<ID>> for EdgeIt<ID> where
    ID: 'a + PrimInt + Unsigned
[src]

type Item = Edge<ID>

fn next(&mut self, _g: &VecGraph<ID>) -> Option<Self::Item>[src]

fn size_hint(&self, _g: &VecGraph<ID>) -> (usize, Option<usize>)[src]

fn count(self, _g: &VecGraph<ID>) -> usize[src]

fn iter<'a>(self, g: &'a G) -> GraphIter<'a, G, Self>

Notable traits for GraphIter<'a, G, I>

impl<'a, G, I> Iterator for GraphIter<'a, G, I> where
    I: GraphIterator<G>, 
type Item = I::Item;
where
    G: Sized
[src]

impl<'a, ID> GraphIterator<VecGraph<ID>> for NeighIt<'a, ID> where
    ID: 'a + PrimInt + Unsigned
[src]

type Item = (Edge<ID>, Node<ID>)

fn next(&mut self, g: &VecGraph<ID>) -> Option<Self::Item>[src]

fn size_hint(&self, _g: &G) -> (usize, Option<usize>)[src]

fn count(self, g: &G) -> usize[src]

fn iter<'a>(self, g: &'a G) -> GraphIter<'a, G, Self>

Notable traits for GraphIter<'a, G, I>

impl<'a, G, I> Iterator for GraphIter<'a, G, I> where
    I: GraphIterator<G>, 
type Item = I::Item;
where
    G: Sized
[src]

impl<'a, ID> GraphSize<'a> for VecGraph<ID> where
    ID: 'a + PrimInt + Unsigned
[src]

type NodeIt = NodeIt<ID>

Type of an iterator over all nodes.

type EdgeIt = EdgeIt<ID>

Type of an iterator over all edges.

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

Return the number of nodes in the graph.

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

Return the number of edges in the graph.

fn nodes_iter(&self) -> Self::NodeIt[src]

Return a graph iterator over all nodes.

fn edges_iter(&self) -> Self::EdgeIt[src]

Return a graph iterator over all edges. Read more

fn nodes(&'a self) -> NodeIterator<'a, Self> where
    Self: Sized
[src]

Return an iterator over all nodes.

fn edges(&'a self) -> EdgeIterator<'a, Self> where
    Self: Sized
[src]

Return an iterator over all edges. Read more

impl<'a, ID> GraphType<'a> for VecGraph<ID> where
    ID: 'a + PrimInt + Unsigned
[src]

type Node = Node<ID>

Type of a node.

type Edge = Edge<ID>

Type of an edge.

impl<'a, ID> IndexGraph<'a> for VecGraph<ID> where
    ID: 'a + PrimInt + Unsigned
[src]

fn node_id(&self, u: Self::Node) -> usize[src]

Return a unique id associated with a node.

fn id2node(&self, id: usize) -> Self::Node[src]

Return the node associated with the given id. Read more

fn edge_id(&self, e: Self::Edge) -> usize[src]

Return a unique id associated with an edge. Read more

fn id2edge(&self, id: usize) -> Self::Edge[src]

Return the edge associated with the given id. Read more

impl<ID> Serialize for VecGraph<ID> where
    ID: Serialize
[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl<'a, ID> Undirected<'a> for VecGraph<ID> where
    ID: 'a + PrimInt + Unsigned
[src]

type NeighIt = NeighIt<'a, ID>

Type of a graph iterator over all incident edges.

fn enodes(&self, e: Self::Edge) -> (Self::Node, Self::Node)[src]

Return the nodes connected by an edge. Read more

fn neigh_iter(&'a self, u: Self::Node) -> Self::NeighIt[src]

Return a graph iterator over the edges adjacent to some node.

fn neighs(&'a self, u: Self::Node) -> GraphIter<'a, Self, Self::NeighIt>

Notable traits for GraphIter<'a, G, I>

impl<'a, G, I> Iterator for GraphIter<'a, G, I> where
    I: GraphIterator<G>, 
type Item = I::Item;
where
    Self: Sized
[src]

Return an iterator over the edges adjacent to some node.

fn neighbors(&'a self) -> Neighbors<'a, Self> where
    Self: Sized
[src]

Return access to the neighbors via an Adjacencies trait. Read more

Auto Trait Implementations

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

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

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

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

impl<ID> UnwindSafe for VecGraph<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.

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<'a, G> Digraph<'a> for G where
    G: GraphSize<'a> + Directed<'a>, 
[src]

impl<'a, G> Graph<'a> for G where
    G: GraphSize<'a> + Undirected<'a>, 
[src]

impl<'a, T> IndexDigraph<'a> for T where
    T: IndexGraph<'a> + Digraph<'a>, 
[src]