pub trait SlotMapGraph<N: Clone, E: Clone> {
    // Required methods
    fn nodes(&self) -> &SlotMap<NodeID, Node<N>>;
    fn nodes_mut(&mut self) -> &mut SlotMap<NodeID, Node<N>>;
    fn edges(&self) -> &SlotMap<EdgeID, Edge<E>>;
    fn edges_mut(&mut self) -> &mut SlotMap<EdgeID, Edge<E>>;

    // Provided methods
    fn node(&self, id: NodeID) -> Option<&Node<N>> { ... }
    fn node_mut(&mut self, id: NodeID) -> Option<&mut Node<N>> { ... }
    fn edge(&self, id: EdgeID) -> Option<&Edge<E>> { ... }
    fn edge_mut(&mut self, id: EdgeID) -> Option<&mut Edge<E>> { ... }
}
Expand description

Provides the most basic functionality of a graph (getting mutable and immutable references to nodes and edges) using the slotmap crate. The GraphWriter trait is implemented for any type that implements SlotMapGraph.

Required Methods§

source

fn nodes(&self) -> &SlotMap<NodeID, Node<N>>

source

fn nodes_mut(&mut self) -> &mut SlotMap<NodeID, Node<N>>

source

fn edges(&self) -> &SlotMap<EdgeID, Edge<E>>

source

fn edges_mut(&mut self) -> &mut SlotMap<EdgeID, Edge<E>>

Provided Methods§

source

fn node(&self, id: NodeID) -> Option<&Node<N>>

source

fn node_mut(&mut self, id: NodeID) -> Option<&mut Node<N>>

source

fn edge(&self, id: EdgeID) -> Option<&Edge<E>>

source

fn edge_mut(&mut self, id: EdgeID) -> Option<&mut Edge<E>>

Implementors§

source§

impl<N: Clone, E: Clone> SlotMapGraph<N, E> for CategoryGraph<N, E>

source§

impl<N: Clone, E: Clone> SlotMapGraph<N, E> for Graph<N, E>