pub trait OverflowingSub<RHS = Self> {
    type Output;

    // Required method
    fn overflowing_sub(self, other: RHS) -> (Self::Output, bool);
}
Expand description

Subtracts two numbers.

Returns a tuple of the sum along with a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped number is returned.

Required Associated Types§

Required Methods§

source

fn overflowing_sub(self, other: RHS) -> (Self::Output, bool)

Implementations on Foreign Types§

source§

impl OverflowingSub for i8

source§

fn overflowing_sub(self, other: i8) -> (i8, bool)

This is a wrapper over the overflowing_sub functions in the standard library, for example this one.

§

type Output = i8

source§

impl OverflowingSub for i16

source§

fn overflowing_sub(self, other: i16) -> (i16, bool)

This is a wrapper over the overflowing_sub functions in the standard library, for example this one.

§

type Output = i16

source§

impl OverflowingSub for i32

source§

fn overflowing_sub(self, other: i32) -> (i32, bool)

This is a wrapper over the overflowing_sub functions in the standard library, for example this one.

§

type Output = i32

source§

impl OverflowingSub for i64

source§

fn overflowing_sub(self, other: i64) -> (i64, bool)

This is a wrapper over the overflowing_sub functions in the standard library, for example this one.

§

type Output = i64

source§

impl OverflowingSub for i128

source§

fn overflowing_sub(self, other: i128) -> (i128, bool)

This is a wrapper over the overflowing_sub functions in the standard library, for example this one.

§

type Output = i128

source§

impl OverflowingSub for isize

source§

fn overflowing_sub(self, other: isize) -> (isize, bool)

This is a wrapper over the overflowing_sub functions in the standard library, for example this one.

§

type Output = isize

source§

impl OverflowingSub for u8

source§

fn overflowing_sub(self, other: u8) -> (u8, bool)

This is a wrapper over the overflowing_sub functions in the standard library, for example this one.

§

type Output = u8

source§

impl OverflowingSub for u16

source§

fn overflowing_sub(self, other: u16) -> (u16, bool)

This is a wrapper over the overflowing_sub functions in the standard library, for example this one.

§

type Output = u16

source§

impl OverflowingSub for u32

source§

fn overflowing_sub(self, other: u32) -> (u32, bool)

This is a wrapper over the overflowing_sub functions in the standard library, for example this one.

§

type Output = u32

source§

impl OverflowingSub for u64

source§

fn overflowing_sub(self, other: u64) -> (u64, bool)

This is a wrapper over the overflowing_sub functions in the standard library, for example this one.

§

type Output = u64

source§

impl OverflowingSub for u128

source§

fn overflowing_sub(self, other: u128) -> (u128, bool)

This is a wrapper over the overflowing_sub functions in the standard library, for example this one.

§

type Output = u128

source§

impl OverflowingSub for usize

source§

fn overflowing_sub(self, other: usize) -> (usize, bool)

This is a wrapper over the overflowing_sub functions in the standard library, for example this one.

§

type Output = usize

Implementors§