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§
Sourcefn as_index(&self) -> u64
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
Sourcefn from_index(value: u64) -> Self
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.