[][src]Trait sp_runtime::traits::CheckedAdd

pub trait CheckedAdd: Add<Self, Output = Self> {
    pub fn checked_add(&self, v: &Self) -> Option<Self>;
}

Performs addition that returns None instead of wrapping around on overflow.

Required methods

pub fn checked_add(&self, v: &Self) -> Option<Self>[src]

Adds two numbers, checking for overflow. If overflow happens, None is returned.

Loading content...

Implementations on Foreign Types

impl<T> CheckedAdd for Ratio<T> where
    T: Clone + Integer + CheckedAdd + CheckedMul
[src]

impl CheckedAdd for BigInt[src]

impl CheckedAdd for BigUint[src]

impl CheckedAdd for i16[src]

impl CheckedAdd for u64[src]

impl CheckedAdd for isize[src]

impl CheckedAdd for i64[src]

impl CheckedAdd for i32[src]

impl CheckedAdd for u32[src]

impl CheckedAdd for u8[src]

impl CheckedAdd for u128[src]

impl CheckedAdd for i128[src]

impl CheckedAdd for u16[src]

impl CheckedAdd for usize[src]

impl CheckedAdd for i8[src]

Loading content...

Implementors

impl CheckedAdd for FixedI64[src]

impl CheckedAdd for FixedI128[src]

impl CheckedAdd for FixedU128[src]

Loading content...