[][src]Struct bigraph::NodeBigraphWrapper

pub struct NodeBigraphWrapper<NodeData, EdgeData, IndexType: PrimInt, Topology> {
    pub topology: Topology,
    // some fields omitted
}

Wrapper for a static graph that adds a binode mapping function.

Bigraphs can be represented with this struct by creating their topology as normal directed graph where each binode is split into its two parts. The binode mapping function then associates the parts with each other.

use bigraph::node_bigraph_wrapper::NodeBigraphWrapper;
use bigraph::{StaticBigraph, MutableGraphContainer, StaticBigraphFromDigraph};
use bigraph::petgraph_impl;

let mut graph = petgraph_impl::new();
let n1 = graph.add_node(0);
let n2 = graph.add_node(1);
graph.add_edge(n1.clone(), n2.clone(), ());
graph.add_edge(n2.clone(), n1.clone(), ());
let bigraph = NodeBigraphWrapper::new(graph, |n| if n % 2 == 0 {n + 1} else {n - 1});
assert_eq!(Some(n2.clone()), bigraph.partner_node(n1.clone()));
assert_eq!(Some(n1.clone()), bigraph.partner_node(n2.clone()));

Fields

topology: Topology

Trait Implementations

impl<NodeData: Debug, EdgeData: Debug, IndexType: Debug + PrimInt, Topology: Debug> Debug for NodeBigraphWrapper<NodeData, EdgeData, IndexType, Topology>[src]

impl<NodeData, EdgeData, IndexType: PrimInt, T: Default> Default for NodeBigraphWrapper<NodeData, EdgeData, IndexType, T>[src]

impl<NodeData: BidirectedNodeData, EdgeData: Clone, IndexType: PrimInt, T: DynamicGraph<NodeData, EdgeData, IndexType>> DynamicBigraph<NodeData, EdgeData, IndexType> for NodeBigraphWrapper<NodeData, EdgeData, IndexType, T>[src]

impl<NodeData, EdgeData, IndexType: PrimInt, T: ImmutableGraphContainer<NodeData, EdgeData, IndexType>> ImmutableGraphContainer<NodeData, EdgeData, IndexType> for NodeBigraphWrapper<NodeData, EdgeData, IndexType, T>[src]

impl<NodeData, EdgeData, IndexType: PrimInt, T: MutableGraphContainer<NodeData, EdgeData, IndexType>> MutableGraphContainer<NodeData, EdgeData, IndexType> for NodeBigraphWrapper<NodeData, EdgeData, IndexType, T>[src]

impl<'a, NodeData, EdgeData, IndexType: PrimInt, T: NavigableGraph<'a, NodeData, EdgeData, IndexType>> NavigableGraph<'a, NodeData, EdgeData, IndexType> for NodeBigraphWrapper<NodeData, EdgeData, IndexType, T>[src]

type OutNeighbors = <T as NavigableGraph<'a, NodeData, EdgeData, IndexType>>::OutNeighbors

type InNeighbors = <T as NavigableGraph<'a, NodeData, EdgeData, IndexType>>::InNeighbors

impl<NodeData, EdgeData, IndexType: PrimInt, T: StaticGraph<NodeData, EdgeData, IndexType>> StaticBigraph<NodeData, EdgeData, IndexType> for NodeBigraphWrapper<NodeData, EdgeData, IndexType, T>[src]

impl<NodeData: Eq + Hash + Debug, EdgeData, IndexType: PrimInt + Debug, Topology: StaticGraph<NodeData, EdgeData, IndexType>> StaticBigraphFromDigraph<NodeData, EdgeData, IndexType> for NodeBigraphWrapper<NodeData, EdgeData, IndexType, Topology>[src]

type Topology = Topology

The type of directed topology the bigraph is created from.

Auto Trait Implementations

impl<NodeData, EdgeData, IndexType, Topology> RefUnwindSafe for NodeBigraphWrapper<NodeData, EdgeData, IndexType, Topology> where
    EdgeData: RefUnwindSafe,
    IndexType: RefUnwindSafe,
    NodeData: RefUnwindSafe,
    Topology: RefUnwindSafe

impl<NodeData, EdgeData, IndexType, Topology> Send for NodeBigraphWrapper<NodeData, EdgeData, IndexType, Topology> where
    EdgeData: Send,
    IndexType: Send,
    NodeData: Send,
    Topology: Send

impl<NodeData, EdgeData, IndexType, Topology> Sync for NodeBigraphWrapper<NodeData, EdgeData, IndexType, Topology> where
    EdgeData: Sync,
    IndexType: Sync,
    NodeData: Sync,
    Topology: Sync

impl<NodeData, EdgeData, IndexType, Topology> Unpin for NodeBigraphWrapper<NodeData, EdgeData, IndexType, Topology> where
    EdgeData: Unpin,
    IndexType: Unpin,
    NodeData: Unpin,
    Topology: Unpin

impl<NodeData, EdgeData, IndexType, Topology> UnwindSafe for NodeBigraphWrapper<NodeData, EdgeData, IndexType, Topology> where
    EdgeData: UnwindSafe,
    IndexType: UnwindSafe,
    NodeData: UnwindSafe,
    Topology: 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<NodeData, EdgeData, IndexType, T> DynamicGraph<NodeData, EdgeData, IndexType> for T where
    IndexType: PrimInt,
    T: ImmutableGraphContainer<NodeData, EdgeData, IndexType> + MutableGraphContainer<NodeData, EdgeData, IndexType> + for<'a> NavigableGraph<'a, NodeData, EdgeData, IndexType>, 
[src]

impl<T> From<T> for T[src]

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

impl<NodeData, EdgeData, IndexType, T> StaticGraph<NodeData, EdgeData, IndexType> for T where
    IndexType: PrimInt,
    T: ImmutableGraphContainer<NodeData, EdgeData, IndexType> + for<'a> NavigableGraph<'a, NodeData, EdgeData, IndexType>, 
[src]

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.