Trait NonZero
pub trait NonZero: Copy + Sized {
type Int: PrimUnsignedInt<NonZero = Self>;
// Required methods
unsafe fn new_unchecked(n: Self::Int) -> Self;
fn new(n: Self::Int) -> Option<Self>;
fn get(self) -> Self::Int;
}Expand description
Functions for primitive type, which has a non-zero correspondant.
Required Associated Types§
type Int: PrimUnsignedInt<NonZero = Self>
type Int: PrimUnsignedInt<NonZero = Self>
The primitive unsigned int correspondant.
Required Methods§
unsafe fn new_unchecked(n: Self::Int) -> Self
unsafe fn new_unchecked(n: Self::Int) -> Self
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.