SafeAdd

Trait SafeAdd 

Source
pub trait SafeAdd: Sized {
    // Required methods
    fn checked_add(&self, r: &Self) -> Option<Self>;
    fn saturating_add(&self, r: &Self) -> Self;
    fn wrapping_add(&self, r: &Self) -> Self;
}

Required Methods§

Source

fn checked_add(&self, r: &Self) -> Option<Self>

Source

fn saturating_add(&self, r: &Self) -> Self

Source

fn wrapping_add(&self, r: &Self) -> Self

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 SafeAdd for f32

Source§

fn checked_add(&self, r: &Self) -> Option<Self>

Source§

fn saturating_add(&self, r: &Self) -> Self

Source§

fn wrapping_add(&self, r: &Self) -> Self

Source§

impl SafeAdd for f64

Source§

fn checked_add(&self, r: &Self) -> Option<Self>

Source§

fn saturating_add(&self, r: &Self) -> Self

Source§

fn wrapping_add(&self, r: &Self) -> Self

Source§

impl SafeAdd for i8

Source§

fn checked_add(&self, r: &Self) -> Option<Self>

Source§

fn saturating_add(&self, r: &Self) -> Self

Source§

fn wrapping_add(&self, r: &Self) -> Self

Source§

impl SafeAdd for i16

Source§

fn checked_add(&self, r: &Self) -> Option<Self>

Source§

fn saturating_add(&self, r: &Self) -> Self

Source§

fn wrapping_add(&self, r: &Self) -> Self

Source§

impl SafeAdd for i32

Source§

fn checked_add(&self, r: &Self) -> Option<Self>

Source§

fn saturating_add(&self, r: &Self) -> Self

Source§

fn wrapping_add(&self, r: &Self) -> Self

Source§

impl SafeAdd for i64

Source§

fn checked_add(&self, r: &Self) -> Option<Self>

Source§

fn saturating_add(&self, r: &Self) -> Self

Source§

fn wrapping_add(&self, r: &Self) -> Self

Source§

impl SafeAdd for i128

Source§

fn checked_add(&self, r: &Self) -> Option<Self>

Source§

fn saturating_add(&self, r: &Self) -> Self

Source§

fn wrapping_add(&self, r: &Self) -> Self

Source§

impl SafeAdd for u8

Source§

fn checked_add(&self, r: &Self) -> Option<Self>

Source§

fn saturating_add(&self, r: &Self) -> Self

Source§

fn wrapping_add(&self, r: &Self) -> Self

Source§

impl SafeAdd for u16

Source§

fn checked_add(&self, r: &Self) -> Option<Self>

Source§

fn saturating_add(&self, r: &Self) -> Self

Source§

fn wrapping_add(&self, r: &Self) -> Self

Source§

impl SafeAdd for u32

Source§

fn checked_add(&self, r: &Self) -> Option<Self>

Source§

fn saturating_add(&self, r: &Self) -> Self

Source§

fn wrapping_add(&self, r: &Self) -> Self

Source§

impl SafeAdd for u64

Source§

fn checked_add(&self, r: &Self) -> Option<Self>

Source§

fn saturating_add(&self, r: &Self) -> Self

Source§

fn wrapping_add(&self, r: &Self) -> Self

Source§

impl SafeAdd for u128

Source§

fn checked_add(&self, r: &Self) -> Option<Self>

Source§

fn saturating_add(&self, r: &Self) -> Self

Source§

fn wrapping_add(&self, r: &Self) -> Self

Implementors§