Skip to main content

WrappingSub

Trait WrappingSub 

Source
pub trait WrappingSub: Sized {
    type Output;

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

Performs subtraction that wraps around on overflow.

Required Associated Types§

Source

type Output

The result type (Self for the primitive impls).

Required Methods§

Source

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

Wrapping (modular) subtraction. 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 WrappingSub for i8

Source§

type Output = i8

Source§

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

Source§

impl WrappingSub for i16

Source§

type Output = i16

Source§

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

Source§

impl WrappingSub for i32

Source§

type Output = i32

Source§

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

Source§

impl WrappingSub for i64

Source§

type Output = i64

Source§

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

Source§

impl WrappingSub for i128

Source§

type Output = i128

Source§

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

Source§

impl WrappingSub for isize

Source§

type Output = isize

Source§

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

Source§

impl WrappingSub for u8

Source§

type Output = u8

Source§

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

Source§

impl WrappingSub for u16

Source§

type Output = u16

Source§

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

Source§

impl WrappingSub for u32

Source§

type Output = u32

Source§

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

Source§

impl WrappingSub for u64

Source§

type Output = u64

Source§

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

Source§

impl WrappingSub for u128

Source§

type Output = u128

Source§

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

Source§

impl WrappingSub for usize

Source§

type Output = usize

Source§

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

Source§

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

Source§

type Output = Wrapping<T>

Source§

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

Implementors§