[][src]Trait nonzero_ext::NonZero

pub trait NonZero {
    type Primitive;
    fn new(n: Self::Primitive) -> Option<Self>
        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.

Loading content...

Required methods

fn new(n: Self::Primitive) -> Option<Self> where
    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.

Loading content...

Implementations on Foreign Types

impl NonZero for NonZeroU8[src]

type Primitive = u8

impl NonZero for NonZeroU16[src]

type Primitive = u16

impl NonZero for NonZeroU32[src]

type Primitive = u32

impl NonZero for NonZeroU64[src]

type Primitive = u64

impl NonZero for NonZeroU128[src]

type Primitive = u128

impl NonZero for NonZeroUsize[src]

type Primitive = usize

Loading content...


Loading content...