Trait gclient::ext::sp_runtime::traits::Zero

source ·
pub trait Zero: Sized + Add<Output = Self> {
    // Required methods
    fn zero() -> Self;
    fn is_zero(&self) -> bool;

    // Provided method
    fn set_zero(&mut self) { ... }
}
Expand description

Defines an additive identity element for Self.

§Laws

a + 0 = a       ∀ a ∈ Self
0 + a = a       ∀ a ∈ Self

Required Methods§

source

fn zero() -> Self

Returns the additive identity element of Self, 0.

§Purity

This function should return the same result at all times regardless of external mutable state, for example values stored in TLS or in static muts.

source

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.

Provided Methods§

source

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Zero for f32

source§

fn zero() -> f32

source§

fn is_zero(&self) -> bool

source§

impl Zero for f64

source§

fn zero() -> f64

source§

fn is_zero(&self) -> bool

source§

impl Zero for i8

source§

fn zero() -> i8

source§

fn is_zero(&self) -> bool

source§

impl Zero for i16

source§

fn zero() -> i16

source§

fn is_zero(&self) -> bool

source§

impl Zero for i32

source§

fn zero() -> i32

source§

fn is_zero(&self) -> bool

source§

impl Zero for i64

source§

fn zero() -> i64

source§

fn is_zero(&self) -> bool

source§

impl Zero for i128

source§

impl Zero for isize

source§

impl Zero for u8

source§

fn zero() -> u8

source§

fn is_zero(&self) -> bool

source§

impl Zero for u16

source§

fn zero() -> u16

source§

fn is_zero(&self) -> bool

source§

impl Zero for u32

source§

fn zero() -> u32

source§

fn is_zero(&self) -> bool

source§

impl Zero for u64

source§

fn zero() -> u64

source§

fn is_zero(&self) -> bool

source§

impl Zero for u128

source§

impl Zero for usize

source§

impl Zero for BigInt

source§

fn zero() -> BigInt

source§

fn set_zero(&mut self)

source§

fn is_zero(&self) -> bool

source§

impl Zero for BigUint

source§

fn zero() -> BigUint

source§

fn set_zero(&mut self)

source§

fn is_zero(&self) -> bool

§

impl Zero for Weight

§

fn zero() -> Weight

§

fn is_zero(&self) -> bool

source§

impl<T> Zero for Ratio<T>
where T: Clone + Integer,

source§

fn zero() -> Ratio<T>

source§

fn is_zero(&self) -> bool

source§

fn set_zero(&mut self)

Implementors§

§

impl Zero for gclient::ext::sp_runtime::biguint::BigUint

§

impl Zero for FixedI64

§

impl Zero for FixedI128

§

impl Zero for FixedU64

§

impl Zero for FixedU128

§

impl Zero for PerU16

§

impl Zero for Perbill

§

impl Zero for Percent

§

impl Zero for Permill

§

impl Zero for Perquintill

source§

impl<T> Zero for Wrapping<T>
where T: Zero, Wrapping<T>: Add<Output = Wrapping<T>>,

§

impl<T, D> Zero for TypeWithDefault<T, D>
where T: Zero + PartialEq, D: Get<T>,