referrerpolicy=no-referrer-when-downgrade

Trait polkadot_sdk_frame::arithmetic::traits::CheckedSub

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

Performs subtraction that returns None instead of wrapping around on underflow.

Required Methods§

source

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

Subtracts two numbers, checking for underflow. If underflow happens, None is returned.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl CheckedSub for i8

source§

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

source§

impl CheckedSub for i16

source§

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

source§

impl CheckedSub for i32

source§

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

source§

impl CheckedSub for i64

source§

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

source§

impl CheckedSub for i128

source§

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

source§

impl CheckedSub for isize

source§

impl CheckedSub for u8

source§

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

source§

impl CheckedSub for u16

source§

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

source§

impl CheckedSub for u32

source§

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

source§

impl CheckedSub for u64

source§

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

source§

impl CheckedSub for u128

source§

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

source§

impl CheckedSub for usize

source§

impl CheckedSub for BigInt

source§

impl CheckedSub for BigUint

§

impl CheckedSub for U128

§

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

§

impl CheckedSub for U128

§

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

§

impl CheckedSub for U256

§

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

§

impl CheckedSub for U512

§

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

source§

impl<T> CheckedSub for Ratio<T>

source§

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

§

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

§

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

Implementors§

§

impl CheckedSub for polkadot_sdk_frame::hashing::U256

§

impl CheckedSub for polkadot_sdk_frame::hashing::U512

§

impl CheckedSub for Weight

§

impl CheckedSub for FixedI64

§

impl CheckedSub for FixedI128

§

impl CheckedSub for FixedU64

§

impl CheckedSub for FixedU128

§

impl CheckedSub for PerU16

§

impl CheckedSub for Perbill

§

impl CheckedSub for Percent

§

impl CheckedSub for Permill

§

impl CheckedSub for Perquintill