Skip to main content

ConstCheckedSub

Trait ConstCheckedSub 

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

Const-compatible checked subtraction.

Required Methods§

Source

fn checked_sub(&self, v: &Self) -> Option<Self>

Checked subtraction. Returns None if overflow occurred.

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 ConstCheckedSub for u8

Source§

fn checked_sub(&self, v: &Self) -> Option<Self>

Source§

impl ConstCheckedSub for u16

Source§

fn checked_sub(&self, v: &Self) -> Option<Self>

Source§

impl ConstCheckedSub for u32

Source§

fn checked_sub(&self, v: &Self) -> Option<Self>

Source§

impl ConstCheckedSub for u64

Source§

fn checked_sub(&self, v: &Self) -> Option<Self>

Source§

impl ConstCheckedSub for u128

Source§

fn checked_sub(&self, v: &Self) -> Option<Self>

Implementors§

Source§

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