Trait PrimitiveInt

Source
pub trait PrimitiveInt:
    'static
    + Send
    + Sync
    + Serialize
    + DeserializeOwned
    + AddAssign
    + SubAssign
    + MulAssign
    + Neg<Output = Self>
    + Shr<usize, Output = Self>
    + Eq
    + Into<Self::Larger>
    + TryFrom<Self::Larger>
    + From<i8>
    + TryFrom<i32>
    + TryFrom<i128>
    + Into<i128>
    + Copy
    + Div<Self, Output = Self>
    + Rem<Self, Output = Self>
    + Display {
    type Larger: PrimitiveInt;

    // Required methods
    fn bits() -> usize;
    fn overflowing_mul(self, rhs: Self) -> Self;
    fn overflowing_sub(self, rhs: Self) -> Self;
}
Expand description

Trait for i8 to i128.

Required Associated Types§

Source

type Larger: PrimitiveInt

The primitive integer that is “twice as large” as this one. The only exception is i128, for which there is no larger primitive integer.

Required Methods§

Source

fn bits() -> usize

Returns the number of bits of this integer type.

Source

fn overflowing_mul(self, rhs: Self) -> Self

Source

fn overflowing_sub(self, rhs: Self) -> Self

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.

Implementations on Foreign Types§

Source§

impl PrimitiveInt for i8

Source§

type Larger = i16

Source§

fn bits() -> usize

Source§

fn overflowing_mul(self, rhs: Self) -> Self

Source§

fn overflowing_sub(self, rhs: Self) -> Self

Source§

impl PrimitiveInt for i16

Source§

type Larger = i32

Source§

fn bits() -> usize

Source§

fn overflowing_mul(self, rhs: Self) -> Self

Source§

fn overflowing_sub(self, rhs: Self) -> Self

Source§

impl PrimitiveInt for i32

Source§

type Larger = i64

Source§

fn bits() -> usize

Source§

fn overflowing_mul(self, rhs: Self) -> Self

Source§

fn overflowing_sub(self, rhs: Self) -> Self

Source§

impl PrimitiveInt for i64

Source§

type Larger = i128

Source§

fn bits() -> usize

Source§

fn overflowing_mul(self, rhs: Self) -> Self

Source§

fn overflowing_sub(self, rhs: Self) -> Self

Source§

impl PrimitiveInt for i128

Source§

type Larger = i128

Source§

fn bits() -> usize

Source§

fn overflowing_mul(self, rhs: Self) -> Self

Source§

fn overflowing_sub(self, rhs: Self) -> Self

Implementors§

OSZAR »