referrerpolicy=no-referrer-when-downgrade

Trait polkadot_sdk_frame::arithmetic::traits::CheckedAdd

source ·
pub trait CheckedAdd: Sized + Add<Output = Self> {
    // Required method
    fn checked_add(&self, v: &Self) -> Option<Self>;
}
Expand description

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

Required Methods§

source

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

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl CheckedAdd for i8

source§

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

source§

impl CheckedAdd for i16

source§

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

source§

impl CheckedAdd for i32

source§

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

source§

impl CheckedAdd for i64

source§

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

source§

impl CheckedAdd for i128

source§

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

source§

impl CheckedAdd for isize

source§

impl CheckedAdd for u8

source§

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

source§

impl CheckedAdd for u16

source§

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

source§

impl CheckedAdd for u32

source§

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

source§

impl CheckedAdd for u64

source§

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

source§

impl CheckedAdd for u128

source§

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

source§

impl CheckedAdd for usize

source§

impl CheckedAdd for BigInt

source§

impl CheckedAdd for BigUint

§

impl CheckedAdd for U128

§

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

§

impl CheckedAdd for U128

§

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

§

impl CheckedAdd for U256

§

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

§

impl CheckedAdd for U512

§

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

source§

impl<T> CheckedAdd for Ratio<T>

source§

fn checked_add(&self, rhs: &Ratio<T>) -> Option<Ratio<T>>

§

impl<T, D> CheckedAdd for TypeWithDefault<T, D>
where T: CheckedAdd, D: Get<T>,

§

fn checked_add( &self, rhs: &TypeWithDefault<T, D>, ) -> Option<TypeWithDefault<T, D>>

Implementors§

§

impl CheckedAdd for polkadot_sdk_frame::hashing::U256

§

impl CheckedAdd for polkadot_sdk_frame::hashing::U512

§

impl CheckedAdd for Weight

§

impl CheckedAdd for FixedI64

§

impl CheckedAdd for FixedI128

§

impl CheckedAdd for FixedU64

§

impl CheckedAdd for FixedU128

§

impl CheckedAdd for PerU16

§

impl CheckedAdd for Perbill

§

impl CheckedAdd for Percent

§

impl CheckedAdd for Permill

§

impl CheckedAdd for Perquintill