pub trait FromWhole<T>: Sized {
    fn from_whole(whole_number: T) -> Self;
    fn from_whole_opt(whole_number: T) -> Option<Self>;
}
Expand description

Helper trait for handling the creation of special numbers from a whole number

Required Methods

Panics

If the number is greater than one can be represented.

Same as Self::from_whole but instead of panicking it returns an Option.

Implementors