pub trait Int:
MinInt
+ PartialEq
+ PartialOrd
+ AddAssign
+ SubAssign
+ BitAndAssign
+ BitOrAssign
+ BitXorAssign
+ ShlAssign<i32>
+ ShrAssign<u32>
+ Add<Output = Self>
+ Sub<Output = Self>
+ Mul<Output = Self>
+ Div<Output = Self>
+ Shr<u32, Output = Self>
+ BitXor<Output = Self>
+ BitAnd<Output = Self> {
const FUZZ_LENGTHS: [u8; 20] = _;
const FUZZ_NUM: usize = _;
Show 17 methods
// Required methods
fn unsigned(self) -> Self::UnsignedInt;
fn from_unsigned(unsigned: Self::UnsignedInt) -> Self;
fn unsigned_abs(self) -> Self::UnsignedInt;
fn from_bool(b: bool) -> Self;
fn logical_shr(self, other: u32) -> Self;
fn abs_diff(self, other: Self) -> Self::UnsignedInt;
fn is_zero(self) -> bool;
fn wrapping_neg(self) -> Self;
fn wrapping_add(self, other: Self) -> Self;
fn wrapping_mul(self, other: Self) -> Self;
fn wrapping_sub(self, other: Self) -> Self;
fn wrapping_shl(self, other: u32) -> Self;
fn wrapping_shr(self, other: u32) -> Self;
fn rotate_left(self, other: u32) -> Self;
fn overflowing_add(self, other: Self) -> (Self, bool);
fn leading_zeros(self) -> u32;
fn ilog2(self) -> u32;
}
Expand description
Trait for some basic operations on integers
Provided Associated Constants§
Sourceconst FUZZ_LENGTHS: [u8; 20] = _
const FUZZ_LENGTHS: [u8; 20] = _
LUT used for maximizing the space covered and minimizing the computational cost of fuzzing
in builtins-test
. For example, Self = u128 produces [0,1,2,7,8,15,16,31,32,63,64,95,96,
111,112,119,120,125,126,127].
Required Methods§
fn unsigned(self) -> Self::UnsignedInt
fn from_unsigned(unsigned: Self::UnsignedInt) -> Self
fn unsigned_abs(self) -> Self::UnsignedInt
fn from_bool(b: bool) -> Self
Sourcefn logical_shr(self, other: u32) -> Self
fn logical_shr(self, other: u32) -> Self
Prevents the need for excessive conversions between signed and unsigned
Sourcefn abs_diff(self, other: Self) -> Self::UnsignedInt
fn abs_diff(self, other: Self) -> Self::UnsignedInt
Absolute difference between two integers.
fn is_zero(self) -> bool
fn wrapping_neg(self) -> Self
fn wrapping_add(self, other: Self) -> Self
fn wrapping_mul(self, other: Self) -> Self
fn wrapping_sub(self, other: Self) -> Self
fn wrapping_shl(self, other: u32) -> Self
fn wrapping_shr(self, other: u32) -> Self
fn rotate_left(self, other: u32) -> Self
fn overflowing_add(self, other: Self) -> (Self, bool)
fn leading_zeros(self) -> u32
fn ilog2(self) -> u32
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.