[][src]Trait nummap::NonZero

pub trait NonZero<Num>: Copy + Sized where
    Num: Number
{ fn new(num: Num) -> Option<Self>;
unsafe fn new_unchecked(num: Num) -> Self;
fn get(self) -> Num; fn num(num: Option<Self>) -> Num { ... } }

A marker trait for types which are NonZero numbers.

Required methods

fn new(num: Num) -> Option<Self>

Constructs a new value returning None for 0.

unsafe fn new_unchecked(num: Num) -> Self

Constructs a new value assuming it is not 0.

fn get(self) -> Num

Gets the inner value.

Loading content...

Provided methods

fn num(num: Option<Self>) -> Num

Gets the inner value or 0.

Loading content...

Implementations on Foreign Types

impl NonZero<usize> for NonZeroUsize[src]

fn num(num: Option<Self>) -> Num[src]

impl NonZero<u8> for NonZeroU8[src]

fn num(num: Option<Self>) -> Num[src]

impl NonZero<u16> for NonZeroU16[src]

fn num(num: Option<Self>) -> Num[src]

impl NonZero<u32> for NonZeroU32[src]

fn num(num: Option<Self>) -> Num[src]

impl NonZero<u64> for NonZeroU64[src]

fn num(num: Option<Self>) -> Num[src]

impl NonZero<u128> for NonZeroU128[src]

fn num(num: Option<Self>) -> Num[src]

impl NonZero<isize> for NonZeroUsize[src]

fn num(num: Option<Self>) -> Num[src]

impl NonZero<i8> for NonZeroU8[src]

fn num(num: Option<Self>) -> Num[src]

impl NonZero<i16> for NonZeroU16[src]

fn num(num: Option<Self>) -> Num[src]

impl NonZero<i32> for NonZeroU32[src]

fn num(num: Option<Self>) -> Num[src]

impl NonZero<i64> for NonZeroU64[src]

fn num(num: Option<Self>) -> Num[src]

impl NonZero<i128> for NonZeroU128[src]

fn num(num: Option<Self>) -> Num[src]

Loading content...

Implementors

Loading content...