pub type Debt<AccountId, B> = Imbalance<<B as Inspect<AccountId>>::AssetId, <B as Inspect<AccountId>>::Balance, <B as Balanced<AccountId>>::OnDropDebt, <B as Balanced<AccountId>>::OnDropCredit>;
Expand description
Imbalance implying that the total_issuance value is less than the sum of all account balances.
Aliased Type§
struct Debt<AccountId, B> { /* private fields */ }
Implementations
source§impl<A: AssetId, B: Balance, OnDrop: HandleImbalanceDrop<A, B>, OppositeOnDrop: HandleImbalanceDrop<A, B>> Imbalance<A, B, OnDrop, OppositeOnDrop>
impl<A: AssetId, B: Balance, OnDrop: HandleImbalanceDrop<A, B>, OppositeOnDrop: HandleImbalanceDrop<A, B>> Imbalance<A, B, OnDrop, OppositeOnDrop>
pub fn zero(asset: A) -> Self
pub fn drop_zero(self) -> Result<(), Self>
pub fn split(self, amount: B) -> (Self, Self)
sourcepub fn extract(&mut self, amount: B) -> Self
pub fn extract(&mut self, amount: B) -> Self
Mutate self
by extracting a new instance with at most amount
value, reducing self
accordingly.
pub fn merge(self, other: Self) -> Result<Self, (Self, Self)>
pub fn subsume(&mut self, other: Self) -> Result<(), Self>
pub fn offset( self, other: Imbalance<A, B, OppositeOnDrop, OnDrop>, ) -> Result<SameOrOther<Self, Imbalance<A, B, OppositeOnDrop, OnDrop>>, (Self, Imbalance<A, B, OppositeOnDrop, OnDrop>)>
pub fn peek(&self) -> B
pub fn asset(&self) -> A
Trait Implementations
source§impl<A: AssetId, B: Balance, OnDrop: HandleImbalanceDrop<A, B>, OppositeOnDrop: HandleImbalanceDrop<A, B>> Debug for Imbalance<A, B, OnDrop, OppositeOnDrop>
impl<A: AssetId, B: Balance, OnDrop: HandleImbalanceDrop<A, B>, OppositeOnDrop: HandleImbalanceDrop<A, B>> Debug for Imbalance<A, B, OnDrop, OppositeOnDrop>
source§impl<A: AssetId, B: Balance, OnDrop: HandleImbalanceDrop<A, B>, OppositeOnDrop: HandleImbalanceDrop<A, B>> Drop for Imbalance<A, B, OnDrop, OppositeOnDrop>
impl<A: AssetId, B: Balance, OnDrop: HandleImbalanceDrop<A, B>, OppositeOnDrop: HandleImbalanceDrop<A, B>> Drop for Imbalance<A, B, OnDrop, OppositeOnDrop>
source§impl<A: AssetId, B: Balance, OnDrop: HandleImbalanceDrop<A, B>, OppositeOnDrop: HandleImbalanceDrop<A, B>> PartialEq for Imbalance<A, B, OnDrop, OppositeOnDrop>
impl<A: AssetId, B: Balance, OnDrop: HandleImbalanceDrop<A, B>, OppositeOnDrop: HandleImbalanceDrop<A, B>> PartialEq for Imbalance<A, B, OnDrop, OppositeOnDrop>
source§impl<A: AssetId, B: Balance, OnDrop: HandleImbalanceDrop<A, B>, OppositeOnDrop: HandleImbalanceDrop<A, B>> TryDrop for Imbalance<A, B, OnDrop, OppositeOnDrop>
impl<A: AssetId, B: Balance, OnDrop: HandleImbalanceDrop<A, B>, OppositeOnDrop: HandleImbalanceDrop<A, B>> TryDrop for Imbalance<A, B, OnDrop, OppositeOnDrop>
source§impl<A: AssetId, B: Balance, OnDrop: HandleImbalanceDrop<A, B>, OppositeOnDrop: HandleImbalanceDrop<A, B>> TryMerge for Imbalance<A, B, OnDrop, OppositeOnDrop>
impl<A: AssetId, B: Balance, OnDrop: HandleImbalanceDrop<A, B>, OppositeOnDrop: HandleImbalanceDrop<A, B>> TryMerge for Imbalance<A, B, OnDrop, OppositeOnDrop>
source§fn try_merge(self, other: Self) -> Result<Self, (Self, Self)>
fn try_merge(self, other: Self) -> Result<Self, (Self, Self)>
Consume
self
and an other
to return a new instance that combines both. Errors with
Err(self, other) if the imbalances cannot be merged (e.g. imbalances of different assets).