Trait petgraph::graph::IndexType

source ·
pub unsafe trait IndexType: Copy + Default + Hash + Ord + Debug + 'static {
    // Required methods
    fn new(x: usize) -> Self;
    fn index(&self) -> usize;
    fn max() -> Self;
}
Expand description

Trait for the unsigned integer type used for node and edge indices.

§Safety

Marked unsafe because: the trait must faithfully preserve and convert index values.

Required Methods§

source

fn new(x: usize) -> Self

source

fn index(&self) -> usize

source

fn max() -> Self

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl IndexType for u8

source§

fn new(x: usize) -> Self

source§

fn index(&self) -> usize

source§

fn max() -> Self

source§

impl IndexType for u16

source§

fn new(x: usize) -> Self

source§

fn index(&self) -> usize

source§

fn max() -> Self

source§

impl IndexType for u32

source§

fn new(x: usize) -> Self

source§

fn index(&self) -> usize

source§

fn max() -> Self

source§

impl IndexType for usize

source§

fn new(x: usize) -> Self

source§

fn index(&self) -> Self

source§

fn max() -> Self

Implementors§