Signed

Trait Signed 

Source
pub trait Signed:
    Integer<Signed = Self>
    + Neg
    + From<i8> {
Show 23 methods // Required methods fn cast_unsigned(self) -> Self::Unsigned; fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>; fn strict_add_unsigned(self, rhs: Self::Unsigned) -> Self; fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>; fn strict_sub_unsigned(self, rhs: Self::Unsigned) -> Self; fn checked_abs(self) -> Option<Self>; fn strict_abs(self) -> 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§

Source

fn cast_unsigned(self) -> Self::Unsigned

Source

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

Source

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

Source

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

Source

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

Source

fn checked_abs(self) -> Option<Self>

Source

fn strict_abs(self) -> 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

See i32::abs.

Source

fn signum(self) -> Self

Source

fn is_positive(self) -> bool

Source

fn is_negative(self) -> bool

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 cast_unsigned(self) -> Self::Unsigned

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn checked_abs(self) -> Option<Self>

Source§

fn strict_abs(self) -> 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 cast_unsigned(self) -> Self::Unsigned

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn checked_abs(self) -> Option<Self>

Source§

fn strict_abs(self) -> 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 cast_unsigned(self) -> Self::Unsigned

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn checked_abs(self) -> Option<Self>

Source§

fn strict_abs(self) -> 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 cast_unsigned(self) -> Self::Unsigned

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn checked_abs(self) -> Option<Self>

Source§

fn strict_abs(self) -> 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 cast_unsigned(self) -> Self::Unsigned

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn checked_abs(self) -> Option<Self>

Source§

fn strict_abs(self) -> 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 cast_unsigned(self) -> Self::Unsigned

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn checked_abs(self) -> Option<Self>

Source§

fn strict_abs(self) -> 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§