Trait petgraph::visit::NodeIndexable [−][src]
pub trait NodeIndexable: GraphBase { fn node_bound(&self) -> usize; fn to_index(&self, a: Self::NodeId) -> usize; fn from_index(&self, i: usize) -> Self::NodeId; }
Expand description
The graph’s NodeId
s map to indices
Required methods
fn node_bound(&self) -> usize
fn node_bound(&self) -> usize
Return an upper bound of the node indices in the graph (suitable for the size of a bitmap).
fn from_index(&self, i: usize) -> Self::NodeId
fn from_index(&self, i: usize) -> Self::NodeId
Convert i
to a node index. i
must be a valid value in the graph.
Implementations on Foreign Types
Implementors
impl<N, E, Ty, Ix> NodeIndexable for StableGraph<N, E, Ty, Ix> where
Ty: EdgeType,
Ix: IndexType,
impl<N, E, Ty: EdgeType, Null: Nullable<Wrapped = E>, Ix: IndexType> NodeIndexable for MatrixGraph<N, E, Ty, Null, Ix>