Skip to main content

WrappingAdd

Trait WrappingAdd 

Source
pub trait WrappingAdd: Sized {
    type Output;

    // Required method
    fn wrapping_add(self, v: Self) -> Self::Output;
}
Expand description

Performs addition that wraps around on overflow.

Required Associated Types§

Source

type Output

The result type (Self for the primitive impls).

Required Methods§

Source

fn wrapping_add(self, v: Self) -> Self::Output

Wrapping (modular) addition. Computes self + other, wrapping around at the boundary of the type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl WrappingAdd for i8

Source§

type Output = i8

Source§

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

Source§

impl WrappingAdd for i16

Source§

type Output = i16

Source§

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

Source§

impl WrappingAdd for i32

Source§

type Output = i32

Source§

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

Source§

impl WrappingAdd for i64

Source§

type Output = i64

Source§

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

Source§

impl WrappingAdd for i128

Source§

type Output = i128

Source§

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

Source§

impl WrappingAdd for isize

Source§

type Output = isize

Source§

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

Source§

impl WrappingAdd for u8

Source§

type Output = u8

Source§

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

Source§

impl WrappingAdd for u16

Source§

type Output = u16

Source§

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

Source§

impl WrappingAdd for u32

Source§

type Output = u32

Source§

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

Source§

impl WrappingAdd for u64

Source§

type Output = u64

Source§

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

Source§

impl WrappingAdd for u128

Source§

type Output = u128

Source§

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

Source§

impl WrappingAdd for usize

Source§

type Output = usize

Source§

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

Source§

impl<T: WrappingAdd<Output = T>> WrappingAdd for Wrapping<T>

Source§

type Output = Wrapping<T>

Source§

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

Implementors§