Trait Signed

Source
pub trait Signed:
    Integer
    + Neg
    + From<i8> {
Show 19 methods // Required methods fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>; fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>; fn checked_abs(self) -> Option<Self>; fn checked_isqrt(self) -> Option<Self>; fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self; fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self; fn saturating_neg(self) -> Self; fn saturating_abs(self) -> Self; fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self; fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self; fn wrapping_abs(self) -> Self; fn unsigned_abs(self) -> Self::Unsigned; fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool); fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool); fn overflowing_abs(self) -> (Self, bool); fn abs(self) -> Self; fn signum(self) -> Self; fn is_positive(self) -> bool; fn is_negative(self) -> bool;
}

Required Methods§

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.

Implementations on Foreign Types§

Source§

impl Signed for i8

Source§

fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>

Source§

fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>

Source§

fn checked_abs(self) -> Option<Self>

Source§

fn checked_isqrt(self) -> Option<Self>

Source§

fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn saturating_neg(self) -> Self

Source§

fn saturating_abs(self) -> Self

Source§

fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn wrapping_abs(self) -> Self

Source§

fn unsigned_abs(self) -> Self::Unsigned

Source§

fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)

Source§

fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)

Source§

fn overflowing_abs(self) -> (Self, bool)

Source§

fn abs(self) -> Self

Source§

fn signum(self) -> Self

Source§

fn is_positive(self) -> bool

Source§

fn is_negative(self) -> bool

Source§

impl Signed for i16

Source§

fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>

Source§

fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>

Source§

fn checked_abs(self) -> Option<Self>

Source§

fn checked_isqrt(self) -> Option<Self>

Source§

fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn saturating_neg(self) -> Self

Source§

fn saturating_abs(self) -> Self

Source§

fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn wrapping_abs(self) -> Self

Source§

fn unsigned_abs(self) -> Self::Unsigned

Source§

fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)

Source§

fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)

Source§

fn overflowing_abs(self) -> (Self, bool)

Source§

fn abs(self) -> Self

Source§

fn signum(self) -> Self

Source§

fn is_positive(self) -> bool

Source§

fn is_negative(self) -> bool

Source§

impl Signed for i32

Source§

fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>

Source§

fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>

Source§

fn checked_abs(self) -> Option<Self>

Source§

fn checked_isqrt(self) -> Option<Self>

Source§

fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn saturating_neg(self) -> Self

Source§

fn saturating_abs(self) -> Self

Source§

fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn wrapping_abs(self) -> Self

Source§

fn unsigned_abs(self) -> Self::Unsigned

Source§

fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)

Source§

fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)

Source§

fn overflowing_abs(self) -> (Self, bool)

Source§

fn abs(self) -> Self

Source§

fn signum(self) -> Self

Source§

fn is_positive(self) -> bool

Source§

fn is_negative(self) -> bool

Source§

impl Signed for i64

Source§

fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>

Source§

fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>

Source§

fn checked_abs(self) -> Option<Self>

Source§

fn checked_isqrt(self) -> Option<Self>

Source§

fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn saturating_neg(self) -> Self

Source§

fn saturating_abs(self) -> Self

Source§

fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn wrapping_abs(self) -> Self

Source§

fn unsigned_abs(self) -> Self::Unsigned

Source§

fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)

Source§

fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)

Source§

fn overflowing_abs(self) -> (Self, bool)

Source§

fn abs(self) -> Self

Source§

fn signum(self) -> Self

Source§

fn is_positive(self) -> bool

Source§

fn is_negative(self) -> bool

Source§

impl Signed for i128

Source§

fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>

Source§

fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>

Source§

fn checked_abs(self) -> Option<Self>

Source§

fn checked_isqrt(self) -> Option<Self>

Source§

fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn saturating_neg(self) -> Self

Source§

fn saturating_abs(self) -> Self

Source§

fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn wrapping_abs(self) -> Self

Source§

fn unsigned_abs(self) -> Self::Unsigned

Source§

fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)

Source§

fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)

Source§

fn overflowing_abs(self) -> (Self, bool)

Source§

fn abs(self) -> Self

Source§

fn signum(self) -> Self

Source§

fn is_positive(self) -> bool

Source§

fn is_negative(self) -> bool

Source§

impl Signed for isize

Source§

fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>

Source§

fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>

Source§

fn checked_abs(self) -> Option<Self>

Source§

fn checked_isqrt(self) -> Option<Self>

Source§

fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn saturating_neg(self) -> Self

Source§

fn saturating_abs(self) -> Self

Source§

fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self

Source§

fn wrapping_abs(self) -> Self

Source§

fn unsigned_abs(self) -> Self::Unsigned

Source§

fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)

Source§

fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)

Source§

fn overflowing_abs(self) -> (Self, bool)

Source§

fn abs(self) -> Self

Source§

fn signum(self) -> Self

Source§

fn is_positive(self) -> bool

Source§

fn is_negative(self) -> bool

Implementors§