SafeSub

Trait SafeSub 

Source
pub trait SafeSub: Sized {
    // Required methods
    fn checked_sub(&self, r: &Self) -> Option<Self>;
    fn saturating_sub(&self, r: &Self) -> Self;
    fn wrapping_sub(&self, r: &Self) -> Self;
}

Required Methods§

Source

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

Source

fn saturating_sub(&self, r: &Self) -> Self

Source

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

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 SafeSub for f32

Source§

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

Source§

fn saturating_sub(&self, r: &Self) -> Self

Source§

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

Source§

impl SafeSub for f64

Source§

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

Source§

fn saturating_sub(&self, r: &Self) -> Self

Source§

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

Source§

impl SafeSub for i8

Source§

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

Source§

fn saturating_sub(&self, r: &Self) -> Self

Source§

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

Source§

impl SafeSub for i16

Source§

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

Source§

fn saturating_sub(&self, r: &Self) -> Self

Source§

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

Source§

impl SafeSub for i32

Source§

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

Source§

fn saturating_sub(&self, r: &Self) -> Self

Source§

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

Source§

impl SafeSub for i64

Source§

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

Source§

fn saturating_sub(&self, r: &Self) -> Self

Source§

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

Source§

impl SafeSub for i128

Source§

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

Source§

fn saturating_sub(&self, r: &Self) -> Self

Source§

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

Source§

impl SafeSub for u8

Source§

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

Source§

fn saturating_sub(&self, r: &Self) -> Self

Source§

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

Source§

impl SafeSub for u16

Source§

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

Source§

fn saturating_sub(&self, r: &Self) -> Self

Source§

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

Source§

impl SafeSub for u32

Source§

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

Source§

fn saturating_sub(&self, r: &Self) -> Self

Source§

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

Source§

impl SafeSub for u64

Source§

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

Source§

fn saturating_sub(&self, r: &Self) -> Self

Source§

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

Source§

impl SafeSub for u128

Source§

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

Source§

fn saturating_sub(&self, r: &Self) -> Self

Source§

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

Implementors§