Skip to main content

Signed

Trait Signed 

Source
pub unsafe trait Signed
where Self: Integral<Signed = Self, Unsigned: Integral<Signed = Self>> + Neg<Output = Self>,
{
Show 23 methods // Required methods fn abs(self) -> Self; fn cast_unsigned(self) -> Self::Unsigned; fn checked_abs(self) -> Option<Self>; fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>; fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>; fn is_negative(self) -> bool; fn is_positive(self) -> bool; fn overflowing_abs(self) -> (Self, bool); fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool); fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool); fn saturating_abs(self) -> Self; fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self; fn saturating_neg(self) -> Self; fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self; fn signum(self) -> Self; fn strict_abs(self) -> Self; fn strict_add_unsigned(self, rhs: Self::Unsigned) -> Self; fn strict_sub_unsigned(self, rhs: Self::Unsigned) -> Self; unsafe fn unchecked_neg(self) -> Self; fn unsigned_abs(self) -> Self::Unsigned; fn wrapping_abs(self) -> Self; fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self; fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self;
}
Expand description

Denotes a signed, integral type.

These include:

§Safety

All items must behave to the same specifications as the standard items.

Required Methods§

Source

fn abs(self) -> Self

See i32::abs.

Source

fn cast_unsigned(self) -> Self::Unsigned

Source

fn checked_abs(self) -> Option<Self>

Source

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

Source

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

Source

fn is_negative(self) -> bool

Source

fn is_positive(self) -> bool

Source

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

Source

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

Source

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

Source

fn saturating_abs(self) -> Self

Source

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

Source

fn saturating_neg(self) -> Self

Source

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

Source

fn signum(self) -> Self

Source

fn strict_abs(self) -> Self

Source

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

Source

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

Source

unsafe fn unchecked_neg(self) -> Self

Source

fn unsigned_abs(self) -> Self::Unsigned

Source

fn wrapping_abs(self) -> Self

Source

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

Source

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

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 abs(self) -> Self

Source§

fn cast_unsigned(self) -> <Self as Integral>::Unsigned

Source§

fn checked_abs(self) -> Option<Self>

Source§

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

Source§

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

Source§

fn is_negative(self) -> bool

Source§

fn is_positive(self) -> bool

Source§

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

Source§

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

Source§

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

Source§

fn signum(self) -> Self

Source§

fn saturating_abs(self) -> Self

Source§

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

Source§

fn saturating_neg(self) -> Self

Source§

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

Source§

fn strict_abs(self) -> Self

Source§

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

Source§

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

Source§

unsafe fn unchecked_neg(self) -> Self

Source§

fn unsigned_abs(self) -> <Self as Integral>::Unsigned

Source§

fn wrapping_abs(self) -> Self

Source§

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

Source§

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

Source§

impl Signed for i16

Source§

fn abs(self) -> Self

Source§

fn cast_unsigned(self) -> <Self as Integral>::Unsigned

Source§

fn checked_abs(self) -> Option<Self>

Source§

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

Source§

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

Source§

fn is_negative(self) -> bool

Source§

fn is_positive(self) -> bool

Source§

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

Source§

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

Source§

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

Source§

fn signum(self) -> Self

Source§

fn saturating_abs(self) -> Self

Source§

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

Source§

fn saturating_neg(self) -> Self

Source§

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

Source§

fn strict_abs(self) -> Self

Source§

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

Source§

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

Source§

unsafe fn unchecked_neg(self) -> Self

Source§

fn unsigned_abs(self) -> <Self as Integral>::Unsigned

Source§

fn wrapping_abs(self) -> Self

Source§

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

Source§

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

Source§

impl Signed for i32

Source§

fn abs(self) -> Self

Source§

fn cast_unsigned(self) -> <Self as Integral>::Unsigned

Source§

fn checked_abs(self) -> Option<Self>

Source§

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

Source§

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

Source§

fn is_negative(self) -> bool

Source§

fn is_positive(self) -> bool

Source§

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

Source§

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

Source§

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

Source§

fn signum(self) -> Self

Source§

fn saturating_abs(self) -> Self

Source§

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

Source§

fn saturating_neg(self) -> Self

Source§

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

Source§

fn strict_abs(self) -> Self

Source§

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

Source§

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

Source§

unsafe fn unchecked_neg(self) -> Self

Source§

fn unsigned_abs(self) -> <Self as Integral>::Unsigned

Source§

fn wrapping_abs(self) -> Self

Source§

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

Source§

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

Source§

impl Signed for i64

Source§

fn abs(self) -> Self

Source§

fn cast_unsigned(self) -> <Self as Integral>::Unsigned

Source§

fn checked_abs(self) -> Option<Self>

Source§

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

Source§

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

Source§

fn is_negative(self) -> bool

Source§

fn is_positive(self) -> bool

Source§

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

Source§

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

Source§

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

Source§

fn signum(self) -> Self

Source§

fn saturating_abs(self) -> Self

Source§

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

Source§

fn saturating_neg(self) -> Self

Source§

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

Source§

fn strict_abs(self) -> Self

Source§

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

Source§

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

Source§

unsafe fn unchecked_neg(self) -> Self

Source§

fn unsigned_abs(self) -> <Self as Integral>::Unsigned

Source§

fn wrapping_abs(self) -> Self

Source§

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

Source§

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

Source§

impl Signed for i128

Source§

fn abs(self) -> Self

Source§

fn cast_unsigned(self) -> <Self as Integral>::Unsigned

Source§

fn checked_abs(self) -> Option<Self>

Source§

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

Source§

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

Source§

fn is_negative(self) -> bool

Source§

fn is_positive(self) -> bool

Source§

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

Source§

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

Source§

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

Source§

fn signum(self) -> Self

Source§

fn saturating_abs(self) -> Self

Source§

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

Source§

fn saturating_neg(self) -> Self

Source§

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

Source§

fn strict_abs(self) -> Self

Source§

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

Source§

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

Source§

unsafe fn unchecked_neg(self) -> Self

Source§

fn unsigned_abs(self) -> <Self as Integral>::Unsigned

Source§

fn wrapping_abs(self) -> Self

Source§

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

Source§

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

Source§

impl Signed for isize

Source§

fn abs(self) -> Self

Source§

fn cast_unsigned(self) -> <Self as Integral>::Unsigned

Source§

fn checked_abs(self) -> Option<Self>

Source§

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

Source§

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

Source§

fn is_negative(self) -> bool

Source§

fn is_positive(self) -> bool

Source§

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

Source§

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

Source§

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

Source§

fn signum(self) -> Self

Source§

fn saturating_abs(self) -> Self

Source§

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

Source§

fn saturating_neg(self) -> Self

Source§

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

Source§

fn strict_abs(self) -> Self

Source§

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

Source§

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

Source§

unsafe fn unchecked_neg(self) -> Self

Source§

fn unsigned_abs(self) -> <Self as Integral>::Unsigned

Source§

fn wrapping_abs(self) -> Self

Source§

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

Source§

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

Implementors§