[][src]Trait lasso::Key

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

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

unsafe fn into_usize(self) -> usize

Returns the usize that represents the current key

Safety

To be safe, into_usize and try_from_usize must be symmetrical, meaning that any usize given to into_usize must be the same after going through try_from_usize

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

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

Loading content...

Implementors

impl Key for LargeSpur[src]

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

Returns None if int is greater than usize::MAX - 1

impl Key for MicroSpur[src]

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

Returns None if int is greater than usize::MAX - 1

impl Key for MiniSpur[src]

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

Returns None if int is greater than usize::MAX - 1

impl Key for Spur[src]

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

Returns None if int is greater than usize::MAX - 1

Loading content...