Skip to main content

ConstCheckedAdd

Trait ConstCheckedAdd 

Source
pub trait ConstCheckedAdd: Sized + ConstOverflowingAdd {
    // Required method
    fn checked_add(&self, v: &Self) -> Option<Self>;
}
Expand description

Const-compatible checked addition.

Required Methods§

Source

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

Checked addition. Returns None if overflow occurred.

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

Source§

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

Source§

impl ConstCheckedAdd for u16

Source§

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

Source§

impl ConstCheckedAdd for u32

Source§

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

Source§

impl ConstCheckedAdd for u64

Source§

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

Source§

impl ConstCheckedAdd for u128

Source§

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

Implementors§

Source§

impl<T: ConstMachineWord + MachineWord, const N: usize> ConstCheckedAdd for FixedUInt<T, N>