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

Corresponding zeroable numeric type.

Required methods

Creates a new non-zero value.

Returns None if the given value is 0.

Creates a new non-zero value without checking that the value is non-zero.

Safety

The given value must be non-zero.

Gets the value as a zeroable type.

Implementations on Foreign Types

Implementors