Trait Key

Source
pub unsafe trait Key: Copy + Eq {
    // Required methods
    fn into_usize(self) -> usize;
    fn try_from_usize(int: usize) -> Option<Self>;
}
Expand description

Types implementing this trait can be used as keys for all Rodeos

§Safety

into/from must be perfectly symmetrical, any key that goes on must be perfectly reproduced with the other

Required Methods§

Source

fn into_usize(self) -> usize

Returns the usize that represents the current key

Source

fn try_from_usize(int: usize) -> Option<Self>

Attempts to create a key from a usize, returning None if it fails

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§