Trait Int

Source
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§

Source

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].

Source

const FUZZ_NUM: usize = _

The number of entries of FUZZ_LENGTHS actually used. The maximum is 20 for u128.

Required Methods§

Source

fn unsigned(self) -> Self::UnsignedInt

Source

fn from_unsigned(unsigned: Self::UnsignedInt) -> Self

Source

fn unsigned_abs(self) -> Self::UnsignedInt

Source

fn from_bool(b: bool) -> Self

Source

fn logical_shr(self, other: u32) -> Self

Prevents the need for excessive conversions between signed and unsigned

Source

fn abs_diff(self, other: Self) -> Self::UnsignedInt

Absolute difference between two integers.

Source

fn is_zero(self) -> bool

Source

fn wrapping_neg(self) -> Self

Source

fn wrapping_add(self, other: Self) -> Self

Source

fn wrapping_mul(self, other: Self) -> Self

Source

fn wrapping_sub(self, other: Self) -> Self

Source

fn wrapping_shl(self, other: u32) -> Self

Source

fn wrapping_shr(self, other: u32) -> Self

Source

fn rotate_left(self, other: u32) -> Self

Source

fn overflowing_add(self, other: Self) -> (Self, bool)

Source

fn leading_zeros(self) -> u32

Source

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.

Implementors§