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§
Sourcefn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
Sourcefn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
Sourcefn checked_abs(self) -> Option<Self>
fn checked_abs(self) -> Option<Self>
See i32::checked_abs
.
Sourcefn checked_isqrt(self) -> Option<Self>
fn checked_isqrt(self) -> Option<Self>
See i32::checked_isqrt
.
Sourcefn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self
fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self
Sourcefn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self
fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self
Sourcefn saturating_neg(self) -> Self
fn saturating_neg(self) -> Self
See i32::saturating_neg
.
Sourcefn saturating_abs(self) -> Self
fn saturating_abs(self) -> Self
See i32::saturating_abs
.
Sourcefn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self
fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self
Sourcefn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self
fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self
Sourcefn wrapping_abs(self) -> Self
fn wrapping_abs(self) -> Self
See i32::wrapping_abs
.
Sourcefn unsigned_abs(self) -> Self::Unsigned
fn unsigned_abs(self) -> Self::Unsigned
See i32::unsigned_abs
.
Sourcefn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
Sourcefn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
Sourcefn overflowing_abs(self) -> (Self, bool)
fn overflowing_abs(self) -> (Self, bool)
See i32::overflowing_abs
.
Sourcefn signum(self) -> Self
fn signum(self) -> Self
See i32::signum
.
Sourcefn is_positive(self) -> bool
fn is_positive(self) -> bool
See i32::is_positive
.
Sourcefn is_negative(self) -> bool
fn is_negative(self) -> bool
See i32::is_negative
.
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.