Trait utils::number::Integer

source ·
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> {
    // Required methods
    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;
}
Expand description

Trait implemented by the primitive integer types.

Required Methods§

source

fn checked_add(self, rhs: Self) -> Option<Self>

source

fn checked_sub(self, rhs: Self) -> Option<Self>

source

fn checked_mul(self, rhs: Self) -> Option<Self>

source

fn trailing_ones(self) -> u32

source

fn trailing_zeros(self) -> u32

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Integer for i8

source§

fn checked_add(self, rhs: Self) -> Option<Self>

source§

fn checked_sub(self, rhs: Self) -> Option<Self>

source§

fn checked_mul(self, rhs: Self) -> Option<Self>

source§

fn trailing_ones(self) -> u32

source§

fn trailing_zeros(self) -> u32

source§

impl Integer for i16

source§

fn checked_add(self, rhs: Self) -> Option<Self>

source§

fn checked_sub(self, rhs: Self) -> Option<Self>

source§

fn checked_mul(self, rhs: Self) -> Option<Self>

source§

fn trailing_ones(self) -> u32

source§

fn trailing_zeros(self) -> u32

source§

impl Integer for i32

source§

fn checked_add(self, rhs: Self) -> Option<Self>

source§

fn checked_sub(self, rhs: Self) -> Option<Self>

source§

fn checked_mul(self, rhs: Self) -> Option<Self>

source§

fn trailing_ones(self) -> u32

source§

fn trailing_zeros(self) -> u32

source§

impl Integer for i64

source§

fn checked_add(self, rhs: Self) -> Option<Self>

source§

fn checked_sub(self, rhs: Self) -> Option<Self>

source§

fn checked_mul(self, rhs: Self) -> Option<Self>

source§

fn trailing_ones(self) -> u32

source§

fn trailing_zeros(self) -> u32

source§

impl Integer for i128

source§

fn checked_add(self, rhs: Self) -> Option<Self>

source§

fn checked_sub(self, rhs: Self) -> Option<Self>

source§

fn checked_mul(self, rhs: Self) -> Option<Self>

source§

fn trailing_ones(self) -> u32

source§

fn trailing_zeros(self) -> u32

source§

impl Integer for isize

source§

fn checked_add(self, rhs: Self) -> Option<Self>

source§

fn checked_sub(self, rhs: Self) -> Option<Self>

source§

fn checked_mul(self, rhs: Self) -> Option<Self>

source§

fn trailing_ones(self) -> u32

source§

fn trailing_zeros(self) -> u32

source§

impl Integer for u8

source§

fn checked_add(self, rhs: Self) -> Option<Self>

source§

fn checked_sub(self, rhs: Self) -> Option<Self>

source§

fn checked_mul(self, rhs: Self) -> Option<Self>

source§

fn trailing_ones(self) -> u32

source§

fn trailing_zeros(self) -> u32

source§

impl Integer for u16

source§

fn checked_add(self, rhs: Self) -> Option<Self>

source§

fn checked_sub(self, rhs: Self) -> Option<Self>

source§

fn checked_mul(self, rhs: Self) -> Option<Self>

source§

fn trailing_ones(self) -> u32

source§

fn trailing_zeros(self) -> u32

source§

impl Integer for u32

source§

fn checked_add(self, rhs: Self) -> Option<Self>

source§

fn checked_sub(self, rhs: Self) -> Option<Self>

source§

fn checked_mul(self, rhs: Self) -> Option<Self>

source§

fn trailing_ones(self) -> u32

source§

fn trailing_zeros(self) -> u32

source§

impl Integer for u64

source§

fn checked_add(self, rhs: Self) -> Option<Self>

source§

fn checked_sub(self, rhs: Self) -> Option<Self>

source§

fn checked_mul(self, rhs: Self) -> Option<Self>

source§

fn trailing_ones(self) -> u32

source§

fn trailing_zeros(self) -> u32

source§

impl Integer for u128

source§

fn checked_add(self, rhs: Self) -> Option<Self>

source§

fn checked_sub(self, rhs: Self) -> Option<Self>

source§

fn checked_mul(self, rhs: Self) -> Option<Self>

source§

fn trailing_ones(self) -> u32

source§

fn trailing_zeros(self) -> u32

source§

impl Integer for usize

source§

fn checked_add(self, rhs: Self) -> Option<Self>

source§

fn checked_sub(self, rhs: Self) -> Option<Self>

source§

fn checked_mul(self, rhs: Self) -> Option<Self>

source§

fn trailing_ones(self) -> u32

source§

fn trailing_zeros(self) -> u32

Implementors§