Skip to main content

AccessMapKey

Trait AccessMapKey 

Source
pub trait AccessMapKey {
    // Required methods
    fn as_index(&self) -> u64;
    fn from_index(value: u64) -> Self;
}
Expand description

For structs which can be mapped to a u64 index

Required Methods§

Source

fn as_index(&self) -> u64

Convert the key to an index

The key 0 must not be be used as it’s reserved for global access

Source

fn from_index(value: u64) -> Self

Convert an index back to the original struct

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 AccessMapKey for u64

Source§

fn as_index(&self) -> u64

Source§

fn from_index(value: u64) -> u64

Implementors§