Trait comlib_math::NonZero [−][src]
pub trait NonZero: Sized + Copy {
type Base;
fn new(value: Self::Base) -> Option<Self>;
unsafe fn new_unchecked(value: Self::Base) -> Self;
fn get(self) -> Self::Base;
}Expand description
Trait implemented by numeric types which cannot contain 0.
Associated Types
Required methods
Creates a new non-zero value.
Returns None if the given value is 0.
unsafe fn new_unchecked(value: Self::Base) -> Self
unsafe fn new_unchecked(value: Self::Base) -> Self
Creates a new non-zero value without checking that the value is non-zero.
Safety
The given value must be non-zero.