IndexType

Trait IndexType 

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

based on petgraph::csr::IndexType; Trait for the unsigned integer type used for node and edge indices.

Required Methods§

Source

fn new(x: usize) -> Self

Create a new index from a usize. Panics if the usize is out of range.

Source

fn index(&self) -> usize

Convert the index to a usize.

Source

fn max() -> Self

Return the maximum value of the index type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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§