Struct frame_support::traits::tokens::fungible::Imbalance [−][src]
pub struct Imbalance<B: Balance, OnDrop: HandleImbalanceDrop<B>, OppositeOnDrop: HandleImbalanceDrop<B>> { /* fields omitted */ }
Expand description
An imbalance in the system, representing a divergence of recorded token supply from the sum of
the balances of all accounts. This is must_use
in order to ensure it gets handled (placing
into an account, settling from an account or altering the supply).
Importantly, it has a special Drop
impl, and cannot be created outside of this module.
Trait Implementations
impl<B: Balance, OnDrop: HandleImbalanceDrop<B>, OppositeOnDrop: HandleImbalanceDrop<B>> Debug for Imbalance<B, OnDrop, OppositeOnDrop> where
B: Debug,
OnDrop: Debug,
OppositeOnDrop: Debug,
impl<B: Balance, OnDrop: HandleImbalanceDrop<B>, OppositeOnDrop: HandleImbalanceDrop<B>> Debug for Imbalance<B, OnDrop, OppositeOnDrop> where
B: Debug,
OnDrop: Debug,
OppositeOnDrop: Debug,
impl<B: Balance, OnDrop: HandleImbalanceDrop<B>, OppositeOnDrop: HandleImbalanceDrop<B>> Default for Imbalance<B, OnDrop, OppositeOnDrop>
impl<B: Balance, OnDrop: HandleImbalanceDrop<B>, OppositeOnDrop: HandleImbalanceDrop<B>> Default for Imbalance<B, OnDrop, OppositeOnDrop>
impl<B: Balance, OnDrop: HandleImbalanceDrop<B>, OppositeOnDrop: HandleImbalanceDrop<B>> Drop for Imbalance<B, OnDrop, OppositeOnDrop>
impl<B: Balance, OnDrop: HandleImbalanceDrop<B>, OppositeOnDrop: HandleImbalanceDrop<B>> Drop for Imbalance<B, OnDrop, OppositeOnDrop>
impl<B: Balance, OnDrop: HandleImbalanceDrop<B>, OppositeOnDrop: HandleImbalanceDrop<B>> Imbalance<B> for Imbalance<B, OnDrop, OppositeOnDrop>
impl<B: Balance, OnDrop: HandleImbalanceDrop<B>, OppositeOnDrop: HandleImbalanceDrop<B>> Imbalance<B> for Imbalance<B, OnDrop, OppositeOnDrop>
The oppositely imbalanced type. They come in pairs.
Drop an instance cleanly. Only works if its self.value()
is zero.
Consume self
and return two independent instances; the first
is guaranteed to be at most amount
and the second will be the remainder. Read more
Consume self
and an other
to return a new instance that combines
both. Read more
Consume an other
to mutate self
into a new instance that combines
both. Read more
fn offset(
self,
other: Imbalance<B, OppositeOnDrop, OnDrop>
) -> SameOrOther<Self, Imbalance<B, OppositeOnDrop, OnDrop>>
fn offset(
self,
other: Imbalance<B, OppositeOnDrop, OnDrop>
) -> SameOrOther<Self, Imbalance<B, OppositeOnDrop, OnDrop>>
Consume self and along with an opposite counterpart to return a combined result. Read more
Consume self
and return two independent instances; the amounts returned will be in
approximately the same ratio as first
:second
. Read more
Consume self and add its two components, defined by the first component’s balance, element-wise to two pre-existing Imbalances. Read more
Consume self and add its two components, defined by the ratio first
:second
,
element-wise to two pre-existing Imbalances. Read more
Consume self and add its two components, defined by the first component’s balance, element-wise into two pre-existing Imbalance refs. Read more
fn ration_merge_into(self, first: u32, second: u32, others: &mut (Self, Self)) where
Balance: From<u32> + Saturating + Div<Output = Balance>,
fn ration_merge_into(self, first: u32, second: u32, others: &mut (Self, Self)) where
Balance: From<u32> + Saturating + Div<Output = Balance>,
Consume self and add its two components, defined by the ratio first
:second
,
element-wise to two pre-existing Imbalances. Read more
Consume self to mutate other
so that it combines both. Just like subsume
, only with
reversed arguments. Read more
Consume self
and maybe an other
to return a new instance that combines
both. Read more
Maybe consume an other
to mutate self
into a new instance that combines
both. Read more
impl<B: PartialEq + Balance, OnDrop: PartialEq + HandleImbalanceDrop<B>, OppositeOnDrop: PartialEq + HandleImbalanceDrop<B>> PartialEq<Imbalance<B, OnDrop, OppositeOnDrop>> for Imbalance<B, OnDrop, OppositeOnDrop>
impl<B: PartialEq + Balance, OnDrop: PartialEq + HandleImbalanceDrop<B>, OppositeOnDrop: PartialEq + HandleImbalanceDrop<B>> PartialEq<Imbalance<B, OnDrop, OppositeOnDrop>> for Imbalance<B, OnDrop, OppositeOnDrop>
impl<B: Balance, OnDrop: HandleImbalanceDrop<B>, OppositeOnDrop: HandleImbalanceDrop<B>> TryDrop for Imbalance<B, OnDrop, OppositeOnDrop>
impl<B: Balance, OnDrop: HandleImbalanceDrop<B>, OppositeOnDrop: HandleImbalanceDrop<B>> TryDrop for Imbalance<B, OnDrop, OppositeOnDrop>
impl<B: Eq + Balance, OnDrop: Eq + HandleImbalanceDrop<B>, OppositeOnDrop: Eq + HandleImbalanceDrop<B>> Eq for Imbalance<B, OnDrop, OppositeOnDrop>
impl<B: Balance, OnDrop: HandleImbalanceDrop<B>, OppositeOnDrop: HandleImbalanceDrop<B>> StructuralEq for Imbalance<B, OnDrop, OppositeOnDrop>
impl<B: Balance, OnDrop: HandleImbalanceDrop<B>, OppositeOnDrop: HandleImbalanceDrop<B>> StructuralPartialEq for Imbalance<B, OnDrop, OppositeOnDrop>
Auto Trait Implementations
impl<B, OnDrop, OppositeOnDrop> RefUnwindSafe for Imbalance<B, OnDrop, OppositeOnDrop> where
B: RefUnwindSafe,
OnDrop: RefUnwindSafe,
OppositeOnDrop: RefUnwindSafe,
impl<B, OnDrop, OppositeOnDrop> Send for Imbalance<B, OnDrop, OppositeOnDrop> where
B: Send,
OnDrop: Send,
OppositeOnDrop: Send,
impl<B, OnDrop, OppositeOnDrop> Sync for Imbalance<B, OnDrop, OppositeOnDrop> where
B: Sync,
OnDrop: Sync,
OppositeOnDrop: Sync,
impl<B, OnDrop, OppositeOnDrop> Unpin for Imbalance<B, OnDrop, OppositeOnDrop> where
B: Unpin,
OnDrop: Unpin,
OppositeOnDrop: Unpin,
impl<B, OnDrop, OppositeOnDrop> UnwindSafe for Imbalance<B, OnDrop, OppositeOnDrop> where
B: UnwindSafe,
OnDrop: UnwindSafe,
OppositeOnDrop: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V
impl<T> MaybeDebug for T where
T: Debug,
impl<T> MaybeDebug for T where
T: Debug,