Trait nonzero_ext::NonZero

source ·
pub trait NonZero {
    type Primitive;

    fn new(n: Self::Primitive) -> Option<Self>
    where
        Self: Sized
; fn get(self) -> Self::Primitive; }
Expand description

A trait identifying a non-zero integral type. It is useful mostly in order to give to genericized helper functions as impl NonZero arguments.

Required Associated Types§

The primitive type (e.g. u8) underlying this integral type.

Required Methods§

Creates a new non-zero object from an integer that might be zero.

Returns the value as a primitive type.

Implementations on Foreign Types§

Implementors§