pub trait NonZeroSigned: NonZero + Signed {
// Required method
fn non_zero_signum(&self) -> NonZeroSign;
// Provided methods
fn non_zero_is_positive(&self) -> bool { ... }
fn non_zero_is_negative(&self) -> bool { ... }
}Expand description
A signed number that can have a nonzero value.
Required Methods§
Sourcefn non_zero_signum(&self) -> NonZeroSign
fn non_zero_signum(&self) -> NonZeroSign
Whether the value is positive or negative.
Provided Methods§
Sourcefn non_zero_is_positive(&self) -> bool
fn non_zero_is_positive(&self) -> bool
Whether x > 0.
Sourcefn non_zero_is_negative(&self) -> bool
fn non_zero_is_negative(&self) -> bool
Whether x < 0.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl NonZeroSigned for NonZero<i8>
The type cannot represent zero, so there is no failure case.
impl NonZeroSigned for NonZero<i8>
The type cannot represent zero, so there is no failure case.
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for NonZero<i16>
The type cannot represent zero, so there is no failure case.
impl NonZeroSigned for NonZero<i16>
The type cannot represent zero, so there is no failure case.
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for NonZero<i32>
The type cannot represent zero, so there is no failure case.
impl NonZeroSigned for NonZero<i32>
The type cannot represent zero, so there is no failure case.
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for NonZero<i64>
The type cannot represent zero, so there is no failure case.
impl NonZeroSigned for NonZero<i64>
The type cannot represent zero, so there is no failure case.
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for NonZero<i128>
The type cannot represent zero, so there is no failure case.
impl NonZeroSigned for NonZero<i128>
The type cannot represent zero, so there is no failure case.
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for NonZero<isize>
The type cannot represent zero, so there is no failure case.
impl NonZeroSigned for NonZero<isize>
The type cannot represent zero, so there is no failure case.
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for NonZero<u8>
The type cannot represent zero, so there is no failure case.
impl NonZeroSigned for NonZero<u8>
The type cannot represent zero, so there is no failure case.
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for NonZero<u16>
The type cannot represent zero, so there is no failure case.
impl NonZeroSigned for NonZero<u16>
The type cannot represent zero, so there is no failure case.
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for NonZero<u32>
The type cannot represent zero, so there is no failure case.
impl NonZeroSigned for NonZero<u32>
The type cannot represent zero, so there is no failure case.
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for NonZero<u64>
The type cannot represent zero, so there is no failure case.
impl NonZeroSigned for NonZero<u64>
The type cannot represent zero, so there is no failure case.
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for NonZero<u128>
The type cannot represent zero, so there is no failure case.
impl NonZeroSigned for NonZero<u128>
The type cannot represent zero, so there is no failure case.
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for NonZero<usize>
The type cannot represent zero, so there is no failure case.
impl NonZeroSigned for NonZero<usize>
The type cannot represent zero, so there is no failure case.
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for i8
impl NonZeroSigned for i8
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for i16
impl NonZeroSigned for i16
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for i32
impl NonZeroSigned for i32
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for i64
impl NonZeroSigned for i64
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for i128
impl NonZeroSigned for i128
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for isize
impl NonZeroSigned for isize
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for u8
impl NonZeroSigned for u8
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for u16
impl NonZeroSigned for u16
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for u32
impl NonZeroSigned for u32
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for u64
impl NonZeroSigned for u64
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for u128
impl NonZeroSigned for u128
fn non_zero_signum(&self) -> NonZeroSign
Source§impl NonZeroSigned for usize
impl NonZeroSigned for usize
fn non_zero_signum(&self) -> NonZeroSign
Implementors§
impl NonZeroSigned for One
The type cannot represent zero, so there is no failure case.
impl NonZeroSigned for Sign
impl NonZeroSigned for SignedOne
The type cannot represent zero, so there is no failure case.