Skip to main content

OverflowingAddUnsigned

Trait OverflowingAddUnsigned 

Source
pub trait OverflowingAddUnsigned: Sized {
    type Unsigned;
    type Output;

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

Overflowing addition of an unsigned value to a signed value.

Required Associated Types§

Source

type Unsigned

The counterpart type of opposite signedness.

Source

type Output

The (owned) result type.

Required Methods§

Source

fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (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 OverflowingAddUnsigned for i8

Source§

impl OverflowingAddUnsigned for i16

Source§

impl OverflowingAddUnsigned for i32

Source§

impl OverflowingAddUnsigned for i64

Source§

impl OverflowingAddUnsigned for i128

Source§

impl OverflowingAddUnsigned for isize

Implementors§