pub trait IndexGraphRef<'a>: UndirectedRef<'a> {
    // Required methods
    fn node_id(&self, u: Self::Node) -> usize;
    fn id2node(&self, id: usize) -> Self::Node;
    fn edge_id(&self, e: Self::Edge) -> usize;
    fn id2edge(&self, id: usize) -> Self::Edge;
}
Expand description

A reference to an indexed graph.

This trait contains methods with a unrestricted lifetime for self.

Required Methods§

source

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

Return a unique id associated with a node.

source

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

Return the node associated with the given id.

The method panics if the id is invalid.

source

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

Return a unique id associated with an edge.

The returned id is the same for the edge and its reverse edge.

source

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

Return the edge associated with the given id.

The method returns the forward edge.

The method panics if the id is invalid.

Implementations on Foreign Types§

source§

impl<'a, G> IndexGraphRef<'a> for NonNull<G>where G: IndexGraph + 'a,

source§

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

source§

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

source§

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

source§

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

source§

impl<'a, G> IndexGraphRef<'a> for &'a Gwhere G: IndexGraph,

source§

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

source§

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

source§

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

source§

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

Implementors§

source§

impl<'a, G> IndexGraphRef<'a> for Network<'a, G>where G: IndexGraph,

source§

impl<'a, G> IndexGraphRef<'a> for ReverseDigraph<'a, G>where G: IndexGraphRef<'a>,