CheckedAdd

Trait CheckedAdd 

Source
pub trait CheckedAdd<Rhs = Self>
where Self: Sized,
{ type Output; type Error; // Required method fn checked_add(self, rhs: Rhs) -> Result<Self::Output, Self::Error>; }

Required Associated Types§

Required Methods§

Source

fn checked_add(self, rhs: Rhs) -> Result<Self::Output, Self::Error>

Checked arithmetic addition to self

§Errors

When the result of the addition can not be represented (e.g. due to an overflow).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl CheckedAdd for i64

Source§

type Output = i64

Source§

type Error = AddError<i64, i64>

Source§

fn checked_add(self, rhs: Self) -> Result<Self::Output, Self::Error>

Source§

impl CheckedAdd for u32

Source§

type Output = u32

Source§

type Error = AddError<u32, u32>

Source§

fn checked_add(self, rhs: Self) -> Result<Self::Output, Self::Error>

Implementors§