Skip to main content

BuildIndex

Trait BuildIndex 

Source
pub trait BuildIndex:
    BuildIndex
    + Copy
    + Eq
    + Ord
    + Debug
    + Hash {
    // Required methods
    fn to_usize(self) -> Option<usize>;
    fn from_usize(value: usize) -> Option<Self>;
}
Expand description

Unsigned dense ID width usable by graph and hypergraph builders.

§Performance

Implementations perform checked conversions in O(1).

Required Methods§

Source

fn to_usize(self) -> Option<usize>

Converts this ID to usize when representable on the current target.

§Performance

This function is O(1).

Source

fn from_usize(value: usize) -> Option<Self>

Converts a usize into this ID width when representable.

§Performance

This function is O(1).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl BuildIndex for u16

Source§

impl BuildIndex for u32

Source§

impl BuildIndex for u64

Source§

impl BuildIndex for usize

Implementors§