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

pub struct Network<'a, 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).

Implementations

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

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

Create a new network adapter wrapping g.

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

Return a reference to 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<'a, G> Clone for Network<'a, G>[src]

impl<'a, G: Copy> Copy for Network<'a, G>[src]

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

type OutIt = NetworkOutIt<G::IncidentIt>

Type of a graph iterator over edges leaving a node.

type InIt = NetworkInIt<G::IncidentIt>

Type of a graph iterator over edges entering a node.

type IncidentIt = NetworkIncidentIt<G::IncidentIt, (G::DirectedEdge, G::Node)>

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, I> GraphIterator<Network<'a, G>> for NetworkNodeIt<I> where
    I: GraphIterator<G>, 
[src]

type Item = I::Item

impl<'a, G, I> GraphIterator<Network<'a, G>> for NetworkEdgeIt<G, I> where
    I: GraphIterator<G>,
    I::Item: Clone
[src]

type Item = NetworkEdge<I::Item>

impl<'a, G, I, N, E> GraphIterator<Network<'a, G>> for NetworkNeighIt<G, I> where
    N: Clone,
    E: Clone,
    I: GraphIterator<G, Item = (E, N)>, 
[src]

type Item = (NetworkEdge<E>, N)

impl<'a, G, I, N, D> GraphIterator<Network<'a, G>> for NetworkOutIt<I> where
    I: GraphIterator<G, Item = (D, N)>,
    D: DirectedEdge
[src]

type Item = (NetworkEdge<D::Edge>, N)

impl<'a, G, I, N, D> GraphIterator<Network<'a, G>> for NetworkInIt<I> where
    I: GraphIterator<G, Item = (D, N)>,
    D: DirectedEdge
[src]

type Item = (NetworkEdge<D::Edge>, N)

impl<'a, G, I, N, D> GraphIterator<Network<'a, G>> for NetworkIncidentIt<I, I::Item> where
    I: GraphIterator<G, Item = (D, N)>,
    N: Clone,
    D: DirectedEdge + Clone
[src]

type Item = (NetworkDirectedEdge<NetworkEdge<D::Edge>>, N)

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

type NodeIt = NetworkNodeIt<G::NodeIt>

Type of an iterator over all nodes.

type EdgeIt = NetworkEdgeIt<G, G::EdgeIt>

Type of an iterator over all edges.

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

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

type Node = G::Node

Type of a node.

type Edge = NetworkEdge<G::Edge>

Type of an edge.

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

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

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

type NeighIt = NetworkNeighIt<G, G::NeighIt>

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<'a, G> RefUnwindSafe for Network<'a, G> where
    G: RefUnwindSafe

impl<'a, G> Send for Network<'a, G> where
    G: Sync

impl<'a, G> Sync for Network<'a, G> where
    G: Sync

impl<'a, G> Unpin for Network<'a, G>

impl<'a, G> UnwindSafe for Network<'a, G> where
    G: RefUnwindSafe

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