Skip to main content

NonZeroSigned

Trait NonZeroSigned 

Source
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§

Source

fn non_zero_signum(&self) -> NonZeroSign

Whether the value is positive or negative.

Provided Methods§

Source

fn non_zero_is_positive(&self) -> bool

Whether x > 0.

Source

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.

Source§

impl NonZeroSigned for NonZero<i16>

The type cannot represent zero, so there is no failure case.

Source§

impl NonZeroSigned for NonZero<i32>

The type cannot represent zero, so there is no failure case.

Source§

impl NonZeroSigned for NonZero<i64>

The type cannot represent zero, so there is no failure case.

Source§

impl NonZeroSigned for NonZero<i128>

The type cannot represent zero, so there is no failure case.

Source§

impl NonZeroSigned for NonZero<isize>

The type cannot represent zero, so there is no failure case.

Source§

impl NonZeroSigned for NonZero<u8>

The type cannot represent zero, so there is no failure case.

Source§

impl NonZeroSigned for NonZero<u16>

The type cannot represent zero, so there is no failure case.

Source§

impl NonZeroSigned for NonZero<u32>

The type cannot represent zero, so there is no failure case.

Source§

impl NonZeroSigned for NonZero<u64>

The type cannot represent zero, so there is no failure case.

Source§

impl NonZeroSigned for NonZero<u128>

The type cannot represent zero, so there is no failure case.

Source§

impl NonZeroSigned for NonZero<usize>

The type cannot represent zero, so there is no failure case.

Source§

impl NonZeroSigned for i8

Source§

impl NonZeroSigned for i16

Source§

impl NonZeroSigned for i32

Source§

impl NonZeroSigned for i64

Source§

impl NonZeroSigned for i128

Source§

impl NonZeroSigned for isize

Source§

impl NonZeroSigned for u8

Source§

impl NonZeroSigned for u16

Source§

impl NonZeroSigned for u32

Source§

impl NonZeroSigned for u64

Source§

impl NonZeroSigned for u128

Source§

impl NonZeroSigned for usize

Implementors§

Source§

impl NonZeroSigned for One

The type cannot represent zero, so there is no failure case.

Source§

impl NonZeroSigned for Sign

Source§

impl NonZeroSigned for SignedOne

The type cannot represent zero, so there is no failure case.