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 NodeIds map to indices

Required Methods§

source

fn node_bound(&self) -> usize

Return an upper bound of the node indices in the graph (suitable for the size of a bitmap).

source

fn to_index(&self, a: Self::NodeId) -> usize

Convert a to an integer index.

source

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.

Implementations on Foreign Types§

source§

impl<'a, G> NodeIndexable for &'a G
where G: NodeIndexable,

source§

fn node_bound(&self) -> usize

source§

fn to_index(&self, a: Self::NodeId) -> usize

source§

fn from_index(&self, i: usize) -> Self::NodeId

Implementors§

source§

impl<'a, G> NodeIndexable for Frozen<'a, G>
where G: NodeIndexable,

source§

impl<E, Ix: IndexType> NodeIndexable for List<E, Ix>

source§

impl<G> NodeIndexable for Reversed<G>
where G: NodeIndexable,

source§

impl<G, F> NodeIndexable for EdgeFiltered<G, F>
where G: NodeIndexable,

source§

impl<G, F> NodeIndexable for NodeFiltered<G, F>
where G: NodeIndexable,

source§

impl<N, E, Ty, Ix> NodeIndexable for Csr<N, E, Ty, Ix>
where Ty: EdgeType, Ix: IndexType,

source§

impl<N, E, Ty, Ix> NodeIndexable for Graph<N, E, Ty, Ix>
where Ty: EdgeType, Ix: IndexType,

source§

impl<N, E, Ty, Ix> NodeIndexable for StableGraph<N, E, Ty, Ix>
where Ty: EdgeType, Ix: IndexType,

source§

impl<N, E, Ty, S> NodeIndexable for GraphMap<N, E, Ty, S>
where N: NodeTrait, Ty: EdgeType, S: BuildHasher,

source§

impl<N, E, Ty: EdgeType, Null: Nullable<Wrapped = E>, Ix: IndexType> NodeIndexable for MatrixGraph<N, E, Ty, Null, Ix>