Signed

Trait Signed 

Source
pub trait Signed {
    // Required method
    fn signum(&self) -> Sign;

    // Provided methods
    fn is_positive(&self) -> bool { ... }
    fn is_negative(&self) -> bool { ... }
}
Expand description

§Signed numbers

A number that is positive, negative or zero.

Required Methods§

Source

fn signum(&self) -> Sign

Returns the sign of the number.

Provided Methods§

Source

fn is_positive(&self) -> bool

Whether the number is (strictly) greater than zero.

Source

fn is_negative(&self) -> bool

Whether the number is (strictly) smaller than zero.

Implementations on Foreign Types§

Source§

impl Signed for i8

Source§

fn signum(&self) -> Sign

Source§

impl Signed for i16

Source§

fn signum(&self) -> Sign

Source§

impl Signed for i32

Source§

fn signum(&self) -> Sign

Source§

impl Signed for i64

Source§

fn signum(&self) -> Sign

Source§

impl Signed for i128

Source§

fn signum(&self) -> Sign

Source§

impl Signed for isize

Source§

fn signum(&self) -> Sign

Source§

impl Signed for u8

Source§

fn signum(&self) -> Sign

Source§

impl Signed for u16

Source§

fn signum(&self) -> Sign

Source§

impl Signed for u32

Source§

fn signum(&self) -> Sign

Source§

impl Signed for u64

Source§

fn signum(&self) -> Sign

Source§

impl Signed for u128

Source§

fn signum(&self) -> Sign

Source§

impl Signed for usize

Source§

fn signum(&self) -> Sign

Source§

impl Signed for NonZeroI8

Source§

fn signum(&self) -> Sign

Source§

impl Signed for NonZeroI16

Source§

fn signum(&self) -> Sign

Source§

impl Signed for NonZeroI32

Source§

fn signum(&self) -> Sign

Source§

impl Signed for NonZeroI64

Source§

fn signum(&self) -> Sign

Source§

impl Signed for NonZeroI128

Source§

fn signum(&self) -> Sign

Source§

impl Signed for NonZeroIsize

Source§

fn signum(&self) -> Sign

Source§

impl Signed for NonZeroU8

Source§

fn signum(&self) -> Sign

Source§

impl Signed for NonZeroU16

Source§

fn signum(&self) -> Sign

Source§

impl Signed for NonZeroU32

Source§

fn signum(&self) -> Sign

Source§

impl Signed for NonZeroU64

Source§

fn signum(&self) -> Sign

Source§

impl Signed for NonZeroU128

Source§

fn signum(&self) -> Sign

Source§

impl Signed for NonZeroUsize

Source§

fn signum(&self) -> Sign

Implementors§

Source§

impl Signed for NonZeroSign

Source§

impl Signed for Sign

Source§

impl Signed for Zero

Source§

impl<const S: usize> Signed for NonZeroUbig<S>

Source§

impl<const S: usize> Signed for Ubig<S>