Trait lasso::Key [−][src]
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
fn into_usize(self) -> usize
[src]
fn into_usize(self) -> usize
[src]Returns the usize
that represents the current key
fn try_from_usize(int: usize) -> Option<Self>
[src]
fn try_from_usize(int: usize) -> Option<Self>
[src]Attempts to create a key from a usize
, returning None
if it fails
Implementors
impl Key for LargeSpur
[src]
impl Key for LargeSpur
[src]fn try_from_usize(int: usize) -> Option<Self>
[src]
fn try_from_usize(int: usize) -> Option<Self>
[src]Returns None
if int
is greater than usize::MAX - 1
fn into_usize(self) -> usize
[src]
impl Key for MicroSpur
[src]
impl Key for MicroSpur
[src]fn try_from_usize(int: usize) -> Option<Self>
[src]
fn try_from_usize(int: usize) -> Option<Self>
[src]Returns None
if int
is greater than u8::MAX - 1
fn into_usize(self) -> usize
[src]
impl Key for MiniSpur
[src]
impl Key for MiniSpur
[src]fn try_from_usize(int: usize) -> Option<Self>
[src]
fn try_from_usize(int: usize) -> Option<Self>
[src]Returns None
if int
is greater than u16::MAX - 1
fn into_usize(self) -> usize
[src]
impl Key for Spur
[src]
impl Key for Spur
[src]fn try_from_usize(int: usize) -> Option<Self>
[src]
fn try_from_usize(int: usize) -> Option<Self>
[src]Returns None
if int
is greater than u32::MAX - 1