doc.rust-lang.org
pub type NonZeroU16 = NonZero<u16>
A u16 that is known not to equal zero.
type_alias
core
Stable since 1.28.0
Version 1.100.0-nightly
doc.rust-lang.org
pub type NonZeroU128 = NonZero<u128>
A u128 that is known not to equal zero.
type_alias
core
Stable since 1.28.0
Version 1.100.0-nightly
doc.rust-lang.org
pub type NonZeroIsize = NonZero<isize>
An isize that is known not to equal zero.
type_alias
core
Stable since 1.34.0
Version 1.100.0-nightly
doc.rust-lang.org
pub type NonZeroI8 = NonZero<i8>
An i8 that is known not to equal zero.
type_alias
core
Stable since 1.34.0
Version 1.100.0-nightly
doc.rust-lang.org
pub type NonZeroI64 = NonZero<i64>
An i64 that is known not to equal zero.
type_alias
core
Stable since 1.34.0
Version 1.100.0-nightly
doc.rust-lang.org
pub type NonZeroI32 = NonZero<i32>
An i32 that is known not to equal zero.
type_alias
core
Stable since 1.34.0
Version 1.100.0-nightly
doc.rust-lang.org
pub type NonZeroI16 = NonZero<i16>
An i16 that is known not to equal zero.
type_alias
core
Stable since 1.34.0
Version 1.100.0-nightly
doc.rust-lang.org
pub type NonZeroI128 = NonZero<i128>
An i128 that is known not to equal zero.
type_alias
core
Stable since 1.34.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn wrapping_neg(self) -> Self
Wrapping (modular) negation. Computes -self, wrapping around at the boundary of the type.
method
core
Stable since 1.71.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn wrapping_abs(self) -> Self
Wrapping absolute value, see i8::wrapping_abs.
method
core
Stable since 1.64.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn unsigned_abs(self) -> NonZero<u8>
Computes the absolute value of self without any wrapping or panicking.
method
core
Stable since 1.64.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of self.
method
core
Stable since 1.53.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn saturating_pow(self, other: u32) -> Self
Raise non-zero value to an integer power. Return NonZero::<u8>::MAX on overflow.
method
core
Stable since 1.64.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn saturating_neg(self) -> Self
Saturating negation. Computes -self, returning NonZero::<i8>::MAX if self == NonZero::<i8>::MIN instead of overflowing.
method
core
Stable since 1.71.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn saturating_mul(self, other: Self) -> Self
Multiplies two non-zero integers together. Return NonZero::<u8>::MAX on overflow.
method
core
Stable since 1.64.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn saturating_add(self, other: u8) -> Self
Adds an unsigned integer to a non-zero value. Return NonZero::<u8>::MAX on overflow.
method
core
Stable since 1.64.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn saturating_abs(self) -> Self
Saturating absolute value, see i8::saturating_abs.
method
core
Stable since 1.64.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn overflowing_neg(self) -> (Self, bool)
Negates self, overflowing if this is equal to the minimum value.
method
core
Stable since 1.71.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn overflowing_abs(self) -> (Self, bool)
Computes the absolute value of self, with overflow information, see i8::overflowing_abs.
method
core
Stable since 1.64.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn new_unchecked(n: T) -> Self
Creates a non-zero without checking whether the value is non-zero. This results in undefined behavior if the value is zero.
associated_function
core
Stable since 1.28.0
Version 1.100.0-nightly