Skip to main content

StrictAddSigned

Trait StrictAddSigned 

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

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

Strict 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 strict_add_signed(self, rhs: Self::Signed) -> Self::Output

Computes self + rhs, panicking on overflow even in release builds.

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

Source§

impl StrictAddSigned for u16

Source§

impl StrictAddSigned for u32

Source§

impl StrictAddSigned for u64

Source§

impl StrictAddSigned for u128

Source§

impl StrictAddSigned for usize

Implementors§