num::traits

Trait WrappingSub

Source
pub trait WrappingSub: Sized + Sub<Output = Self> {
    // Required method
    fn wrapping_sub(&self, v: &Self) -> Self;
}
Expand description

Performs subtraction that wraps around on overflow.

Required Methods§

Source

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

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", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl WrappingSub for i8

Source§

fn wrapping_sub(&self, v: &i8) -> i8

Source§

impl WrappingSub for i16

Source§

fn wrapping_sub(&self, v: &i16) -> i16

Source§

impl WrappingSub for i32

Source§

fn wrapping_sub(&self, v: &i32) -> i32

Source§

impl WrappingSub for i64

Source§

fn wrapping_sub(&self, v: &i64) -> i64

Source§

impl WrappingSub for i128

Source§

fn wrapping_sub(&self, v: &i128) -> i128

Source§

impl WrappingSub for isize

Source§

fn wrapping_sub(&self, v: &isize) -> isize

Source§

impl WrappingSub for u8

Source§

fn wrapping_sub(&self, v: &u8) -> u8

Source§

impl WrappingSub for u16

Source§

fn wrapping_sub(&self, v: &u16) -> u16

Source§

impl WrappingSub for u32

Source§

fn wrapping_sub(&self, v: &u32) -> u32

Source§

impl WrappingSub for u64

Source§

fn wrapping_sub(&self, v: &u64) -> u64

Source§

impl WrappingSub for u128

Source§

fn wrapping_sub(&self, v: &u128) -> u128

Source§

impl WrappingSub for usize

Source§

fn wrapping_sub(&self, v: &usize) -> usize

Source§

impl<T> WrappingSub for Wrapping<T>
where T: WrappingSub, Wrapping<T>: Sub<Output = Wrapping<T>>,

Source§

fn wrapping_sub(&self, v: &Wrapping<T>) -> Wrapping<T>

Implementors§