Skip to main content

WrappingArithmetic

Trait WrappingArithmetic 

pub trait WrappingArithmetic: Sized + Sealed {
    // Required methods
    fn wrapping_add(self, rhs: Self) -> Self;
    fn wrapping_sub(self, rhs: Self) -> Self;
    fn wrapping_mul(self, rhs: Self) -> Self;
}
Expand description

Primitive integer types supported by the wrapping arithmetic wrappers.

Required Methods§

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

Returns the wrapping sum of self and rhs.

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

Returns the wrapping difference of self and rhs.

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

Returns the wrapping product of self and rhs.

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§

§

impl WrappingArithmetic for i8

§

fn wrapping_add(self, rhs: i8) -> i8

§

fn wrapping_sub(self, rhs: i8) -> i8

§

fn wrapping_mul(self, rhs: i8) -> i8

§

impl WrappingArithmetic for i16

§

fn wrapping_add(self, rhs: i16) -> i16

§

fn wrapping_sub(self, rhs: i16) -> i16

§

fn wrapping_mul(self, rhs: i16) -> i16

§

impl WrappingArithmetic for i32

§

fn wrapping_add(self, rhs: i32) -> i32

§

fn wrapping_sub(self, rhs: i32) -> i32

§

fn wrapping_mul(self, rhs: i32) -> i32

§

impl WrappingArithmetic for i64

§

fn wrapping_add(self, rhs: i64) -> i64

§

fn wrapping_sub(self, rhs: i64) -> i64

§

fn wrapping_mul(self, rhs: i64) -> i64

§

impl WrappingArithmetic for i128

§

fn wrapping_add(self, rhs: i128) -> i128

§

fn wrapping_sub(self, rhs: i128) -> i128

§

fn wrapping_mul(self, rhs: i128) -> i128

§

impl WrappingArithmetic for isize

§

fn wrapping_add(self, rhs: isize) -> isize

§

fn wrapping_sub(self, rhs: isize) -> isize

§

fn wrapping_mul(self, rhs: isize) -> isize

§

impl WrappingArithmetic for u8

§

fn wrapping_add(self, rhs: u8) -> u8

§

fn wrapping_sub(self, rhs: u8) -> u8

§

fn wrapping_mul(self, rhs: u8) -> u8

§

impl WrappingArithmetic for u16

§

fn wrapping_add(self, rhs: u16) -> u16

§

fn wrapping_sub(self, rhs: u16) -> u16

§

fn wrapping_mul(self, rhs: u16) -> u16

§

impl WrappingArithmetic for u32

§

fn wrapping_add(self, rhs: u32) -> u32

§

fn wrapping_sub(self, rhs: u32) -> u32

§

fn wrapping_mul(self, rhs: u32) -> u32

§

impl WrappingArithmetic for u64

§

fn wrapping_add(self, rhs: u64) -> u64

§

fn wrapping_sub(self, rhs: u64) -> u64

§

fn wrapping_mul(self, rhs: u64) -> u64

§

impl WrappingArithmetic for u128

§

fn wrapping_add(self, rhs: u128) -> u128

§

fn wrapping_sub(self, rhs: u128) -> u128

§

fn wrapping_mul(self, rhs: u128) -> u128

§

impl WrappingArithmetic for usize

§

fn wrapping_add(self, rhs: usize) -> usize

§

fn wrapping_sub(self, rhs: usize) -> usize

§

fn wrapping_mul(self, rhs: usize) -> usize

Implementors§