Trait lasso::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

Implementors§