Skip to main content

WrappingArithmetic

Trait WrappingArithmetic 

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

Source

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

Returns the wrapping sum of self and rhs.

Source

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

Returns the wrapping difference of self and rhs.

Source

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§

Source§

impl WrappingArithmetic for i8

Source§

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

Source§

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

Source§

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

Source§

impl WrappingArithmetic for i16

Source§

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

Source§

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

Source§

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

Source§

impl WrappingArithmetic for i32

Source§

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

Source§

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

Source§

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

Source§

impl WrappingArithmetic for i64

Source§

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

Source§

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

Source§

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

Source§

impl WrappingArithmetic for i128

Source§

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

Source§

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

Source§

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

Source§

impl WrappingArithmetic for isize

Source§

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

Source§

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

Source§

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

Source§

impl WrappingArithmetic for u8

Source§

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

Source§

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

Source§

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

Source§

impl WrappingArithmetic for u16

Source§

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

Source§

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

Source§

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

Source§

impl WrappingArithmetic for u32

Source§

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

Source§

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

Source§

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

Source§

impl WrappingArithmetic for u64

Source§

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

Source§

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

Source§

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

Source§

impl WrappingArithmetic for u128

Source§

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

Source§

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

Source§

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

Source§

impl WrappingArithmetic for usize

Source§

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

Source§

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

Source§

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

Implementors§