Trait petgraph::visit::NodeIndexable
source · pub trait NodeIndexable: GraphBase {
// Required methods
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§
sourcefn 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).
sourcefn 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.
Object Safety§
This trait is not object safe.