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§
sourcefn wrapping_sub(&self, v: &Self) -> Self
fn wrapping_sub(&self, v: &Self) -> Self
Wrapping (modular) subtraction. Computes self - other
, wrapping around at the boundary
of the type.
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl WrappingSub for i8
impl WrappingSub for i8
fn wrapping_sub(&self, v: &i8) -> i8
source§impl WrappingSub for i16
impl WrappingSub for i16
fn wrapping_sub(&self, v: &i16) -> i16
source§impl WrappingSub for i32
impl WrappingSub for i32
fn wrapping_sub(&self, v: &i32) -> i32
source§impl WrappingSub for i64
impl WrappingSub for i64
fn wrapping_sub(&self, v: &i64) -> i64
source§impl WrappingSub for i128
impl WrappingSub for i128
fn wrapping_sub(&self, v: &i128) -> i128
source§impl WrappingSub for isize
impl WrappingSub for isize
fn wrapping_sub(&self, v: &isize) -> isize
source§impl WrappingSub for u8
impl WrappingSub for u8
fn wrapping_sub(&self, v: &u8) -> u8
source§impl WrappingSub for u16
impl WrappingSub for u16
fn wrapping_sub(&self, v: &u16) -> u16
source§impl WrappingSub for u32
impl WrappingSub for u32
fn wrapping_sub(&self, v: &u32) -> u32
source§impl WrappingSub for u64
impl WrappingSub for u64
fn wrapping_sub(&self, v: &u64) -> u64
source§impl WrappingSub for u128
impl WrappingSub for u128
fn wrapping_sub(&self, v: &u128) -> u128
source§impl WrappingSub for usize
impl WrappingSub for usize
fn wrapping_sub(&self, v: &usize) -> usize
source§impl<T> WrappingSub for Wrapping<T>
impl<T> WrappingSub for Wrapping<T>
fn wrapping_sub(&self, v: &Wrapping<T>) -> Wrapping<T>
Implementors§
impl WrappingSub for BoxedUint
Available on crate feature
alloc
only.