Trait nonzero_ext::NonZero [−][src]
pub trait NonZero { type Primitive; fn new(n: Self::Primitive) -> Option<Self>
where
Self: Sized; fn get(self) -> Self::Primitive; }
A trait identifying a non-zero integral type. It is useful mostly
in order to give to genericized helper functions as impl NonZero
arguments.
Associated Types
type Primitive
The primitive type (e.g. u8
) underlying this integral type.
Required Methods
fn new(n: Self::Primitive) -> Option<Self> where
Self: Sized,
Self: Sized,
Creates a new non-zero object from an integer that might be zero.
fn get(self) -> Self::Primitive
Returns the value as a primitive type.
Implementations on Foreign Types
impl NonZero for NonZeroU8
[src]
impl NonZero for NonZeroU8
impl NonZero for NonZeroU16
[src]
impl NonZero for NonZeroU16
impl NonZero for NonZeroU32
[src]
impl NonZero for NonZeroU32
impl NonZero for NonZeroU64
[src]
impl NonZero for NonZeroU64
impl NonZero for NonZeroU128
[src]
impl NonZero for NonZeroU128
impl NonZero for NonZeroUsize
[src]
impl NonZero for NonZeroUsize