cl_structures::index_map

Trait MapIndex

Source
pub trait MapIndex: Debug {
    // Required methods
    fn from_usize(value: usize) -> Self;
    fn get(&self) -> usize;
}
Expand description

An index into a IndexMap. For full type-safety, there should be a unique MapIndex for each IndexMap.

Required Methods§

Source

fn from_usize(value: usize) -> Self

Constructs an MapIndex from a usize without checking bounds.

The provided value should be within the bounds of its associated container.

Source

fn get(&self) -> usize

Gets the index of the MapIndex by value

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.

Implementors§