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" u64s.

Required Methods

Convert back from a u64. This is unsafe, since it is only infallible if the u64 originally came from type Self.

Convert to a u64. This should be infallible.

Provided Methods

verify that the conversion is lossless

Implementors