[][src]Struct rs_graph::adapters::network::Network

pub struct Network<G>(_);

The network graph adaptor.

It is meant to be used by borrowing the underlying graph.

let g = classes::cycle::<LinkedListGraph>(5);
let n = Network::new(&g);

The network inherits all trait implementations from the underlying graph. In particular, if the underlying graph implements IndexGraph then nodes and edges of the network are numbered, too:

  • The node_id is the same as in the underlying graph,
  • the edge with id i is mapped to the edges 2*i (forward edge) and 2*i+1 (backward edge).

Methods

impl<'a, G> Network<G> where
    G: Digraph<'a>, 
[src]

pub fn new(g: G) -> Self[src]

Create a new network adapter wrapping g.

pub fn as_graph(&self) -> &G[src]

Return a reference to the underlying graph.

pub fn into_graph(self) -> G[src]

Return the underlying graph.

pub fn from_edge(&self, e: G::Edge) -> NetworkEdge<G::Edge>[src]

Return the forward edge corresponding the edge e in the underlying graph.

Trait Implementations

impl<G: Clone> Clone for Network<G>[src]

impl<G: Copy> Copy for Network<G>[src]

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

type OutEdge = NetworkOutEdge<G::IncidentEdge>

Type of a graph iterator over edges leaving a node.

type InEdge = NetworkInEdge<G::IncidentEdge>

Type of a graph iterator over edges entering a node.

type IncidentEdge = NetworkIncidentEdge<G::IncidentEdge>

Type of an iterator over all incident edges.

type DirectedEdge = NetworkDirectedEdge<Self::Edge>

Type of a directed edge.

impl<'a, G> DirectedRef<'a> for Network<&'a G> where
    G: 'a + Directed<'a>, 
[src]

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

type NodeIter = G::NodeIter

Type of an iterator over all nodes.

type EdgeIter = NetworkEdgeIter<G::EdgeIter>

Type of an iterator over all edges.

impl<'a, G> GraphSizeRef<'a> for Network<&'a G> where
    G: Directed<'a>, 
[src]

impl<'a, G> GraphType<'a> for Network<G> where
    G: Digraph<'a>, 
[src]

type Node = G::Node

Type of a node.

type Edge = NetworkEdge<G::Edge>

Type of an edge.

impl<'a, G> IndexGraph<'a> for Network<G> where
    G: Digraph<'a> + IndexGraph<'a>, 
[src]

impl<'a, G> IndexGraphRef<'a> for Network<&'a G> where
    G: Directed<'a> + IndexGraph<'a>, 
[src]

impl<'a, G> Undirected<'a> for Network<G> where
    G: Digraph<'a>, 
[src]

type Neigh = NetworkEdge<G::Neigh>

Type of a graph iterator over all incident edges.

impl<'a, G> UndirectedRef<'a> for Network<&'a G> where
    G: Directed<'a>, 
[src]

Auto Trait Implementations

impl<G> RefUnwindSafe for Network<G> where
    G: RefUnwindSafe

impl<G> Send for Network<G> where
    G: Send

impl<G> Sync for Network<G> where
    G: Sync

impl<G> Unpin for Network<G> where
    G: Unpin

impl<G> UnwindSafe for Network<G> where
    G: UnwindSafe

Blanket Implementations

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

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

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

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

impl<T> From<T> for T[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]

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

impl<'a, G> NumberedDigraph<'a> for G where
    G: Digraph<'a> + NumberedGraph<'a>,
    <G as GraphType<'a>>::Node: Indexable,
    <G as GraphType<'a>>::Edge: Indexable
[src]

impl<'a, G> NumberedGraph<'a> for G where
    G: Graph<'a>,
    <G as GraphType<'a>>::Node: Indexable,
    <G as GraphType<'a>>::Edge: Indexable
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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.