Trait ImbalanceAccounting
pub trait ImbalanceAccounting<Balance>: UnsafeConstructorDestructor<Balance> + UnsafeManualAccounting<Balance> {
// Required methods
fn amount(&self) -> Balance;
fn saturating_take(
&mut self,
amount: Balance,
) -> Box<dyn ImbalanceAccounting<Balance>>;
}Expand description
Helper trait to be used for generic Imbalance, helpful for tracking multiple concrete types of
Imbalance using dynamic dispatch of this trait.
Required Methods§
fn amount(&self) -> Balance
fn amount(&self) -> Balance
Get inner imbalance amount.
fn saturating_take(
&mut self,
amount: Balance,
) -> Box<dyn ImbalanceAccounting<Balance>>
fn saturating_take( &mut self, amount: Balance, ) -> Box<dyn ImbalanceAccounting<Balance>>
Saturating remove amount from the inner imbalance, and return it as a new imbalance
instance.