Skip to main content

CaddUnsigned

Trait CaddUnsigned 

Source
pub trait CaddUnsigned: Sized {
    type Other;
    type Output;
    type Error;

    // Required method
    fn cadd_unsigned(
        self,
        other: Self::Other,
    ) -> Result<Self::Output, Self::Error>;
}
Expand description

Checked addition: computes add_unsigned(a, b), returning an error if overflow occured.

See also: module documentation.

Required Associated Types§

Required Methods§

Source

fn cadd_unsigned(self, other: Self::Other) -> Result<Self::Output, Self::Error>

Checked addition: computes add_unsigned(a, b), returning an error if overflow occured.

Wrapper for checked_add_unsigned.

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 CaddUnsigned for i8

Source§

fn cadd_unsigned(self, other: u8) -> Result<i8, Error>

Checked addition: computes add_unsigned(a, b), returning an error if overflow occured.

Wrapper for i8::checked_add_unsigned.

Source§

type Other = u8

Source§

type Output = i8

Source§

type Error = Error

Source§

impl CaddUnsigned for i16

Source§

fn cadd_unsigned(self, other: u16) -> Result<i16, Error>

Checked addition: computes add_unsigned(a, b), returning an error if overflow occured.

Wrapper for i16::checked_add_unsigned.

Source§

type Other = u16

Source§

type Output = i16

Source§

type Error = Error

Source§

impl CaddUnsigned for i32

Source§

fn cadd_unsigned(self, other: u32) -> Result<i32, Error>

Checked addition: computes add_unsigned(a, b), returning an error if overflow occured.

Wrapper for i32::checked_add_unsigned.

Source§

type Other = u32

Source§

type Output = i32

Source§

type Error = Error

Source§

impl CaddUnsigned for i64

Source§

fn cadd_unsigned(self, other: u64) -> Result<i64, Error>

Checked addition: computes add_unsigned(a, b), returning an error if overflow occured.

Wrapper for i64::checked_add_unsigned.

Source§

type Other = u64

Source§

type Output = i64

Source§

type Error = Error

Source§

impl CaddUnsigned for i128

Source§

fn cadd_unsigned(self, other: u128) -> Result<i128, Error>

Checked addition: computes add_unsigned(a, b), returning an error if overflow occured.

Wrapper for i128::checked_add_unsigned.

Source§

type Other = u128

Source§

type Output = i128

Source§

type Error = Error

Source§

impl CaddUnsigned for isize

Source§

fn cadd_unsigned(self, other: usize) -> Result<isize, Error>

Checked addition: computes add_unsigned(a, b), returning an error if overflow occured.

Wrapper for isize::checked_add_unsigned.

Source§

type Other = usize

Source§

type Output = isize

Source§

type Error = Error

Implementors§