Skip to main content

ConstWrappingSub

Trait ConstWrappingSub 

Source
pub trait ConstWrappingSub: Sized + ConstOverflowingSub {
    // Required method
    fn wrapping_sub(&self, v: &Self) -> Self;
}
Expand description

Const-compatible wrapping subtraction.

Required Methods§

Source

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

Wrapping (modular) subtraction. Computes self - v, 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 ConstWrappingSub for u8

Source§

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

Source§

impl ConstWrappingSub for u16

Source§

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

Source§

impl ConstWrappingSub for u32

Source§

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

Source§

impl ConstWrappingSub for u64

Source§

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

Source§

impl ConstWrappingSub for u128

Source§

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

Implementors§

Source§

impl<T: ConstMachineWord + MachineWord, const N: usize> ConstWrappingSub for FixedUInt<T, N>