[]Trait astral::math::num::NonZero

pub trait NonZero: Copy where
    <Self::Int as PrimUnsignedInt>::NonZero == Self, 
{ type Int: PrimUnsignedInt; unsafe fn new_unchecked(n: Self::Int) -> Self;
fn new(n: Self::Int) -> Option<Self>;
fn get(self) -> Self::Int; }

Functions for primitive type, which has a non-zero correspondant.

Associated Types

type Int: PrimUnsignedInt

The primitive unsigned int correspondant.

Loading content...

Required methods

unsafe fn new_unchecked(n: Self::Int) -> Self

Create a non-zero without checking the value.

Safety

The value must not be zero.

fn new(n: Self::Int) -> Option<Self>

Create a non-zero if the given value is not zero.

fn get(self) -> Self::Int

Returns the value as the primitive type.

Loading content...

Implementations on Foreign Types

impl NonZero for NonZeroU128

type Int = u128

impl NonZero for NonZeroU64

type Int = u64

impl NonZero for NonZeroU16

type Int = u16

impl NonZero for NonZeroU8

type Int = u8

impl NonZero for NonZeroU32

type Int = u32

impl NonZero for NonZeroUsize

type Int = usize

Loading content...

Implementors

Loading content...