Skip to main content

StrictSub

Trait StrictSub 

Source
pub trait StrictSub: Sized {
    type Output;

    // Required method
    fn strict_sub(self, v: Self) -> Self::Output;
}
Expand description

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

Required Associated Types§

Source

type Output

The result type (Self for the primitive impls).

Required Methods§

Source

fn strict_sub(self, v: Self) -> 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§

type Output = i8

Source§

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

Source§

impl StrictSub for i16

Source§

type Output = i16

Source§

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

Source§

impl StrictSub for i32

Source§

type Output = i32

Source§

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

Source§

impl StrictSub for i64

Source§

type Output = i64

Source§

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

Source§

impl StrictSub for i128

Source§

type Output = i128

Source§

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

Source§

impl StrictSub for isize

Source§

type Output = isize

Source§

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

Source§

impl StrictSub for u8

Source§

type Output = u8

Source§

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

Source§

impl StrictSub for u16

Source§

type Output = u16

Source§

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

Source§

impl StrictSub for u32

Source§

type Output = u32

Source§

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

Source§

impl StrictSub for u64

Source§

type Output = u64

Source§

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

Source§

impl StrictSub for u128

Source§

type Output = u128

Source§

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

Source§

impl StrictSub for usize

Source§

type Output = usize

Source§

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

Implementors§