Skip to main content

OverflowingAddSigned

Trait OverflowingAddSigned 

Source
pub trait OverflowingAddSigned: Sized {
    type Signed;
    type Output;

    // Required method
    fn overflowing_add_signed(self, rhs: Self::Signed) -> (Self::Output, bool);
}
Expand description

Overflowing addition of a signed value to an unsigned value.

Required Associated Types§

Source

type Signed

The counterpart type of opposite signedness.

Source

type Output

The (owned) result type.

Required Methods§

Source

fn overflowing_add_signed(self, rhs: Self::Signed) -> (Self::Output, bool)

Computes self + rhs, returning the wrapped sum and whether overflow occurred.

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

Source§

impl OverflowingAddSigned for u16

Source§

impl OverflowingAddSigned for u32

Source§

impl OverflowingAddSigned for u64

Source§

impl OverflowingAddSigned for u128

Source§

impl OverflowingAddSigned for usize

Implementors§