Skip to main content

StrictSub

Trait StrictSub 

Source
pub trait StrictSub: Sized + Sub<Self> {
    // Required method
    fn strict_sub(self, v: Self) -> <Self as Sub<Self>>::Output;
}
Expand description

Performs subtraction that panics on overflow, even in release builds.

Required Methods§

Source

fn strict_sub(self, v: Self) -> <Self as Sub<Self>>::Output

Strict subtraction. Computes self - v, panicking on overflow regardless of whether overflow checks are enabled.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl StrictSub for i8

Source§

fn strict_sub(self, v: Self) -> Self

Source§

impl StrictSub for i16

Source§

fn strict_sub(self, v: Self) -> Self

Source§

impl StrictSub for i32

Source§

fn strict_sub(self, v: Self) -> Self

Source§

impl StrictSub for i64

Source§

fn strict_sub(self, v: Self) -> Self

Source§

impl StrictSub for i128

Source§

fn strict_sub(self, v: Self) -> Self

Source§

impl StrictSub for isize

Source§

fn strict_sub(self, v: Self) -> Self

Source§

impl StrictSub for u8

Source§

fn strict_sub(self, v: Self) -> Self

Source§

impl StrictSub for u16

Source§

fn strict_sub(self, v: Self) -> Self

Source§

impl StrictSub for u32

Source§

fn strict_sub(self, v: Self) -> Self

Source§

impl StrictSub for u64

Source§

fn strict_sub(self, v: Self) -> Self

Source§

impl StrictSub for u128

Source§

fn strict_sub(self, v: Self) -> Self

Source§

impl StrictSub for usize

Source§

fn strict_sub(self, v: Self) -> Self

Implementors§