Trait tinyset::u64set::Fits64
[−]
[src]
pub trait Fits64: Clone + Debug { unsafe fn from_u64(x: u64) -> Self; fn to_u64(self) -> u64; fn test_fits64(self) -> bool { ... } }
This describes a type which can be stored in 64 bits without loss.
It is defined for all signed and unsigned integer types. In both
cases, we store "small" integers as "small" u64
s.
Required Methods
unsafe fn from_u64(x: u64) -> Self
Convert back from a u64. This is unsafe, since it is only
infallible if the u64
originally came from type Self
.
fn to_u64(self) -> u64
Convert to a u64
. This should be infallible.
Provided Methods
fn test_fits64(self) -> bool
verify that the conversion is lossless