pub trait Integer:
Number
+ Not<Output = Self>
+ BitAnd<Output = Self>
+ BitAndAssign
+ BitOr<Output = Self>
+ BitOrAssign
+ BitXor<Output = Self>
+ BitXorAssign
+ Shl<Output = Self>
+ Shl<u32, Output = Self>
+ ShlAssign
+ ShlAssign<u32>
+ Shr<Output = Self>
+ Shr<u32, Output = Self>
+ ShrAssign
+ ShrAssign<u32>
+ TryInto<i128> {
type Unsigned: UnsignedInteger;
type Signed: SignedInteger;
// Required methods
fn abs_diff(self, rhs: Self) -> Self::Unsigned;
fn checked_add(self, rhs: Self) -> Option<Self>;
fn checked_sub(self, rhs: Self) -> Option<Self>;
fn checked_mul(self, rhs: Self) -> Option<Self>;
fn trailing_ones(self) -> u32;
fn trailing_zeros(self) -> u32;
fn unsigned_abs(self) -> Self::Unsigned;
}
Expand description
Trait implemented by the primitive integer types.
Required Associated Types§
type Unsigned: UnsignedInteger
type Signed: SignedInteger
Required Methods§
fn abs_diff(self, rhs: Self) -> Self::Unsigned
fn checked_add(self, rhs: Self) -> Option<Self>
fn checked_sub(self, rhs: Self) -> Option<Self>
fn checked_mul(self, rhs: Self) -> Option<Self>
fn trailing_ones(self) -> u32
fn trailing_zeros(self) -> u32
fn unsigned_abs(self) -> Self::Unsigned
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.