pub unsafe trait Key: Copy + Eq {
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§
sourcefn into_usize(self) -> usize
fn into_usize(self) -> usize
Returns the usize
that represents the current key
sourcefn try_from_usize(int: usize) -> Option<Self>
fn try_from_usize(int: usize) -> Option<Self>
Attempts to create a key from a usize
, returning None
if it fails