pub trait Integer:
Number
+ Ord
+ Eq
+ Not
+ BitAnd<Self>
+ for<'a> BitAnd<&'a Self>
+ BitAndAssign<Self>
+ for<'a> BitAndAssign<&'a Self>
+ BitOr<Self>
+ for<'a> BitOr<&'a Self>
+ BitOrAssign<Self>
+ for<'a> BitOrAssign<&'a Self>
+ BitXor<Self>
+ for<'a> BitXor<&'a Self>
+ BitXorAssign<Self>
+ for<'a> BitXorAssign<&'a Self>
+ Shl<Self>
+ for<'a> Shl<&'a Self>
+ ShlAssign<Self>
+ for<'a> ShlAssign<&'a Self>
+ Shr<Self>
+ for<'a> Shr<&'a Self>
+ ShrAssign<Self>
+ for<'a> ShrAssign<&'a Self>
+ TryFrom<u32>
+ TryFrom<u64>
+ TryFrom<u128>
+ TryFrom<usize>
+ TryFrom<i32>
+ TryFrom<i64>
+ TryFrom<i128>
+ TryFrom<isize>
+ TryInto<u8>
+ TryInto<u16>
+ TryInto<u32>
+ TryInto<u64>
+ TryInto<u128>
+ TryInto<usize>
+ TryInto<i8>
+ TryInto<i16>
+ TryInto<i32>
+ TryInto<i64>
+ TryInto<i128>
+ TryInto<isize>
+ Hash
+ Binary
+ Octal
+ LowerHex
+ UpperHex {
type Unsigned: Unsigned;
type Signed: Signed;
Show 67 methods
// Required methods
fn to_unsigned(self) -> Self::Unsigned;
fn to_signed(self) -> Self::Signed;
fn count_ones(self) -> u32;
fn count_zeros(self) -> u32;
fn leading_zeros(self) -> u32;
fn trailing_zeros(self) -> u32;
fn leading_ones(self) -> u32;
fn trailing_ones(self) -> u32;
fn rotate_left(self, n: u32) -> Self;
fn rotate_right(self, n: u32) -> Self;
fn swap_bytes(self) -> Self;
fn reverse_bits(self) -> Self;
fn from_be(x: Self) -> Self;
fn from_le(x: Self) -> Self;
fn to_be(self) -> Self;
fn to_le(self) -> Self;
fn checked_add(self, rhs: Self) -> Option<Self>;
unsafe fn unchecked_add(self, rhs: Self) -> Self;
fn checked_sub(self, rhs: Self) -> Option<Self>;
unsafe fn unchecked_sub(self, rhs: Self) -> Self;
fn checked_mul(self, rhs: Self) -> Option<Self>;
unsafe fn unchecked_mul(self, rhs: Self) -> Self;
fn checked_div(self, rhs: Self) -> Option<Self>;
fn checked_div_euclid(self, rhs: Self) -> Option<Self>;
fn checked_rem(self, rhs: Self) -> Option<Self>;
fn checked_rem_euclid(self, rhs: Self) -> Option<Self>;
fn checked_neg(self) -> Option<Self>;
fn checked_shl(self, rhs: u32) -> Option<Self>;
fn checked_shr(self, rhs: u32) -> Option<Self>;
fn checked_pow(self, exp: u32) -> Option<Self>;
fn saturating_add(self, rhs: Self) -> Self;
fn saturating_sub(self, rhs: Self) -> Self;
fn saturating_mul(self, rhs: Self) -> Self;
fn saturating_div(self, rhs: Self) -> Self;
fn saturating_pow(self, exp: u32) -> Self;
fn wrapping_add(self, rhs: Self) -> Self;
fn wrapping_sub(self, rhs: Self) -> Self;
fn wrapping_mul(self, rhs: Self) -> Self;
fn wrapping_div(self, rhs: Self) -> Self;
fn wrapping_div_euclid(self, rhs: Self) -> Self;
fn wrapping_rem(self, rhs: Self) -> Self;
fn wrapping_rem_euclid(self, rhs: Self) -> Self;
fn wrapping_neg(self) -> Self;
fn wrapping_shl(self, rhs: u32) -> Self;
fn wrapping_shr(self, rhs: u32) -> Self;
fn wrapping_pow(self, exp: u32) -> Self;
fn overflowing_add(self, rhs: Self) -> (Self, bool);
fn overflowing_sub(self, rhs: Self) -> (Self, bool);
fn overflowing_mul(self, rhs: Self) -> (Self, bool);
fn overflowing_div(self, rhs: Self) -> (Self, bool);
fn overflowing_div_euclid(self, rhs: Self) -> (Self, bool);
fn overflowing_rem(self, rhs: Self) -> (Self, bool);
fn overflowing_rem_euclid(self, rhs: Self) -> (Self, bool);
fn overflowing_neg(self) -> (Self, bool);
fn overflowing_shl(self, rhs: u32) -> (Self, bool);
fn overflowing_shr(self, rhs: u32) -> (Self, bool);
fn overflowing_pow(self, exp: u32) -> (Self, bool);
fn pow(self, exp: u32) -> Self;
fn isqrt(self) -> Self;
fn ilog(self, base: Self) -> u32;
fn ilog2(self) -> u32;
fn ilog10(self) -> u32;
fn checked_ilog(self, base: Self) -> Option<u32>;
fn checked_ilog2(self) -> Option<u32>;
fn checked_ilog10(self) -> Option<u32>;
fn abs_diff(self, other: Self) -> Self::Unsigned;
fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError>;
}
Required Associated Types§
Required Methods§
fn to_unsigned(self) -> Self::Unsigned
fn to_signed(self) -> Self::Signed
Sourcefn count_ones(self) -> u32
fn count_ones(self) -> u32
See i32::count_ones
.
Sourcefn count_zeros(self) -> u32
fn count_zeros(self) -> u32
See i32::count_zeros
.
Sourcefn leading_zeros(self) -> u32
fn leading_zeros(self) -> u32
See i32::leading_zeros
.
Sourcefn trailing_zeros(self) -> u32
fn trailing_zeros(self) -> u32
See i32::trailing_zeros
.
Sourcefn leading_ones(self) -> u32
fn leading_ones(self) -> u32
See i32::leading_ones
.
Sourcefn trailing_ones(self) -> u32
fn trailing_ones(self) -> u32
See i32::trailing_ones
.
Sourcefn rotate_left(self, n: u32) -> Self
fn rotate_left(self, n: u32) -> Self
See i32::rotate_left
.
Sourcefn rotate_right(self, n: u32) -> Self
fn rotate_right(self, n: u32) -> Self
See i32::rotate_right
.
Sourcefn swap_bytes(self) -> Self
fn swap_bytes(self) -> Self
See i32::swap_bytes
.
Sourcefn reverse_bits(self) -> Self
fn reverse_bits(self) -> Self
See i32::reverse_bits
.
Sourcefn from_be(x: Self) -> Self
fn from_be(x: Self) -> Self
See i32::from_be
.
Sourcefn from_le(x: Self) -> Self
fn from_le(x: Self) -> Self
See i32::from_le
.
Sourcefn to_be(self) -> Self
fn to_be(self) -> Self
See i32::to_be
.
Sourcefn to_le(self) -> Self
fn to_le(self) -> Self
See i32::to_le
.
Sourcefn checked_add(self, rhs: Self) -> Option<Self>
fn checked_add(self, rhs: Self) -> Option<Self>
See i32::checked_add
.
Sourceunsafe fn unchecked_add(self, rhs: Self) -> Self
unsafe fn unchecked_add(self, rhs: Self) -> Self
Sourcefn checked_sub(self, rhs: Self) -> Option<Self>
fn checked_sub(self, rhs: Self) -> Option<Self>
See i32::checked_sub
.
Sourceunsafe fn unchecked_sub(self, rhs: Self) -> Self
unsafe fn unchecked_sub(self, rhs: Self) -> Self
Sourcefn checked_mul(self, rhs: Self) -> Option<Self>
fn checked_mul(self, rhs: Self) -> Option<Self>
See i32::checked_mul
.
Sourceunsafe fn unchecked_mul(self, rhs: Self) -> Self
unsafe fn unchecked_mul(self, rhs: Self) -> Self
Sourcefn checked_div(self, rhs: Self) -> Option<Self>
fn checked_div(self, rhs: Self) -> Option<Self>
See i32::checked_div
.
Sourcefn checked_div_euclid(self, rhs: Self) -> Option<Self>
fn checked_div_euclid(self, rhs: Self) -> Option<Self>
Sourcefn checked_rem(self, rhs: Self) -> Option<Self>
fn checked_rem(self, rhs: Self) -> Option<Self>
See i32::checked_rem
.
Sourcefn checked_rem_euclid(self, rhs: Self) -> Option<Self>
fn checked_rem_euclid(self, rhs: Self) -> Option<Self>
Sourcefn checked_neg(self) -> Option<Self>
fn checked_neg(self) -> Option<Self>
See i32::checked_neg
.
Sourcefn checked_shl(self, rhs: u32) -> Option<Self>
fn checked_shl(self, rhs: u32) -> Option<Self>
See i32::checked_shl
.
Sourcefn checked_shr(self, rhs: u32) -> Option<Self>
fn checked_shr(self, rhs: u32) -> Option<Self>
See i32::checked_shr
.
Sourcefn checked_pow(self, exp: u32) -> Option<Self>
fn checked_pow(self, exp: u32) -> Option<Self>
See i32::checked_pow
.
Sourcefn saturating_add(self, rhs: Self) -> Self
fn saturating_add(self, rhs: Self) -> Self
See i32::saturating_add
.
Sourcefn saturating_sub(self, rhs: Self) -> Self
fn saturating_sub(self, rhs: Self) -> Self
See i32::saturating_sub
.
Sourcefn saturating_mul(self, rhs: Self) -> Self
fn saturating_mul(self, rhs: Self) -> Self
See i32::saturating_mul
.
Sourcefn saturating_div(self, rhs: Self) -> Self
fn saturating_div(self, rhs: Self) -> Self
See i32::saturating_div
.
Sourcefn saturating_pow(self, exp: u32) -> Self
fn saturating_pow(self, exp: u32) -> Self
See i32::saturating_pow
.
Sourcefn wrapping_add(self, rhs: Self) -> Self
fn wrapping_add(self, rhs: Self) -> Self
See i32::wrapping_add
.
Sourcefn wrapping_sub(self, rhs: Self) -> Self
fn wrapping_sub(self, rhs: Self) -> Self
See i32::wrapping_sub
.
Sourcefn wrapping_mul(self, rhs: Self) -> Self
fn wrapping_mul(self, rhs: Self) -> Self
See i32::wrapping_mul
.
Sourcefn wrapping_div(self, rhs: Self) -> Self
fn wrapping_div(self, rhs: Self) -> Self
See i32::wrapping_div
.
Sourcefn wrapping_div_euclid(self, rhs: Self) -> Self
fn wrapping_div_euclid(self, rhs: Self) -> Self
Sourcefn wrapping_rem(self, rhs: Self) -> Self
fn wrapping_rem(self, rhs: Self) -> Self
See i32::wrapping_rem
.
Sourcefn wrapping_rem_euclid(self, rhs: Self) -> Self
fn wrapping_rem_euclid(self, rhs: Self) -> Self
Sourcefn wrapping_neg(self) -> Self
fn wrapping_neg(self) -> Self
See i32::wrapping_neg
.
Sourcefn wrapping_shl(self, rhs: u32) -> Self
fn wrapping_shl(self, rhs: u32) -> Self
See i32::wrapping_shl
.
Sourcefn wrapping_shr(self, rhs: u32) -> Self
fn wrapping_shr(self, rhs: u32) -> Self
See i32::wrapping_shr
.
Sourcefn wrapping_pow(self, exp: u32) -> Self
fn wrapping_pow(self, exp: u32) -> Self
See i32::wrapping_pow
.
Sourcefn overflowing_add(self, rhs: Self) -> (Self, bool)
fn overflowing_add(self, rhs: Self) -> (Self, bool)
See i32::overflowing_add
.
Sourcefn overflowing_sub(self, rhs: Self) -> (Self, bool)
fn overflowing_sub(self, rhs: Self) -> (Self, bool)
See i32::overflowing_sub
.
Sourcefn overflowing_mul(self, rhs: Self) -> (Self, bool)
fn overflowing_mul(self, rhs: Self) -> (Self, bool)
See i32::overflowing_mul
.
Sourcefn overflowing_div(self, rhs: Self) -> (Self, bool)
fn overflowing_div(self, rhs: Self) -> (Self, bool)
See i32::overflowing_div
.
Sourcefn overflowing_div_euclid(self, rhs: Self) -> (Self, bool)
fn overflowing_div_euclid(self, rhs: Self) -> (Self, bool)
Sourcefn overflowing_rem(self, rhs: Self) -> (Self, bool)
fn overflowing_rem(self, rhs: Self) -> (Self, bool)
See i32::overflowing_rem
.
Sourcefn overflowing_rem_euclid(self, rhs: Self) -> (Self, bool)
fn overflowing_rem_euclid(self, rhs: Self) -> (Self, bool)
Sourcefn overflowing_neg(self) -> (Self, bool)
fn overflowing_neg(self) -> (Self, bool)
See i32::overflowing_neg
.
Sourcefn overflowing_shl(self, rhs: u32) -> (Self, bool)
fn overflowing_shl(self, rhs: u32) -> (Self, bool)
See i32::overflowing_shl
.
Sourcefn overflowing_shr(self, rhs: u32) -> (Self, bool)
fn overflowing_shr(self, rhs: u32) -> (Self, bool)
See i32::overflowing_shr
.
Sourcefn overflowing_pow(self, exp: u32) -> (Self, bool)
fn overflowing_pow(self, exp: u32) -> (Self, bool)
See i32::overflowing_pow
.
Sourcefn isqrt(self) -> Self
fn isqrt(self) -> Self
See i32::isqrt
.
Sourcefn ilog2(self) -> u32
fn ilog2(self) -> u32
See i32::ilog2
.
Sourcefn ilog10(self) -> u32
fn ilog10(self) -> u32
See i32::ilog10
.
Sourcefn checked_ilog(self, base: Self) -> Option<u32>
fn checked_ilog(self, base: Self) -> Option<u32>
See i32::checked_ilog
.
Sourcefn checked_ilog2(self) -> Option<u32>
fn checked_ilog2(self) -> Option<u32>
See i32::checked_ilog2
.
Sourcefn checked_ilog10(self) -> Option<u32>
fn checked_ilog10(self) -> Option<u32>
See i32::checked_ilog10
.
Sourcefn abs_diff(self, other: Self) -> Self::Unsigned
fn abs_diff(self, other: Self) -> Self::Unsigned
See i32::abs_diff
.
Sourcefn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError>
fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError>
See i32::from_str_radix
.
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.