referrerpolicy=no-referrer-when-downgrade
polkadot_sdk_frame::token::fungibles

Type Alias Debt

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

§

impl<A, B, OnDrop, OppositeOnDrop> Imbalance<A, B, OnDrop, OppositeOnDrop>
where A: AssetId, B: Balance, OnDrop: HandleImbalanceDrop<A, B>, OppositeOnDrop: HandleImbalanceDrop<A, B>,

pub fn zero(asset: A) -> Imbalance<A, B, OnDrop, OppositeOnDrop>

pub fn drop_zero(self) -> Result<(), Imbalance<A, B, OnDrop, OppositeOnDrop>>

pub fn split( self, amount: B, ) -> (Imbalance<A, B, OnDrop, OppositeOnDrop>, Imbalance<A, B, OnDrop, OppositeOnDrop>)

pub fn extract(&mut self, amount: B) -> Imbalance<A, B, OnDrop, OppositeOnDrop>

Mutate self by extracting a new instance with at most amount value, reducing self accordingly.

pub fn merge( self, other: Imbalance<A, B, OnDrop, OppositeOnDrop>, ) -> Result<Imbalance<A, B, OnDrop, OppositeOnDrop>, (Imbalance<A, B, OnDrop, OppositeOnDrop>, Imbalance<A, B, OnDrop, OppositeOnDrop>)>

pub fn subsume( &mut self, other: Imbalance<A, B, OnDrop, OppositeOnDrop>, ) -> Result<(), Imbalance<A, B, OnDrop, OppositeOnDrop>>

pub fn offset( self, other: Imbalance<A, B, OppositeOnDrop, OnDrop>, ) -> Result<SameOrOther<Imbalance<A, B, OnDrop, OppositeOnDrop>, Imbalance<A, B, OppositeOnDrop, OnDrop>>, (Imbalance<A, B, OnDrop, OppositeOnDrop>, Imbalance<A, B, OppositeOnDrop, OnDrop>)>

pub fn peek(&self) -> B

pub fn asset(&self) -> A

Trait Implementations

§

impl<A, B, OnDrop, OppositeOnDrop> Debug for Imbalance<A, B, OnDrop, OppositeOnDrop>
where A: AssetId, B: Balance, OnDrop: HandleImbalanceDrop<A, B>, OppositeOnDrop: HandleImbalanceDrop<A, B>,

§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<A, B, OnDrop, OppositeOnDrop> Drop for Imbalance<A, B, OnDrop, OppositeOnDrop>
where A: AssetId, B: Balance, OnDrop: HandleImbalanceDrop<A, B>, OppositeOnDrop: HandleImbalanceDrop<A, B>,

§

fn drop(&mut self)

Executes the destructor for this type. Read more
§

impl<A, B, OnDrop, OppositeOnDrop> PartialEq for Imbalance<A, B, OnDrop, OppositeOnDrop>
where A: AssetId, B: Balance, OnDrop: HandleImbalanceDrop<A, B>, OppositeOnDrop: HandleImbalanceDrop<A, B>,

§

fn eq(&self, other: &Imbalance<A, B, OnDrop, OppositeOnDrop>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<A, B, OnDrop, OppositeOnDrop> TryDrop for Imbalance<A, B, OnDrop, OppositeOnDrop>
where A: AssetId, B: Balance, OnDrop: HandleImbalanceDrop<A, B>, OppositeOnDrop: HandleImbalanceDrop<A, B>,

§

fn try_drop(self) -> Result<(), Imbalance<A, B, OnDrop, OppositeOnDrop>>

Drop an instance cleanly. Only works if its value represents “no-operation”.

§

impl<A, B, OnDrop, OppositeOnDrop> TryMerge for Imbalance<A, B, OnDrop, OppositeOnDrop>
where A: AssetId, B: Balance, OnDrop: HandleImbalanceDrop<A, B>, OppositeOnDrop: HandleImbalanceDrop<A, B>,

§

fn try_merge( self, other: Imbalance<A, B, OnDrop, OppositeOnDrop>, ) -> Result<Imbalance<A, B, OnDrop, OppositeOnDrop>, (Imbalance<A, B, OnDrop, OppositeOnDrop>, Imbalance<A, B, OnDrop, OppositeOnDrop>)>

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).
§

impl<A, B, OnDrop, OppositeOnDrop> Eq for Imbalance<A, B, OnDrop, OppositeOnDrop>
where A: AssetId, B: Balance, OnDrop: HandleImbalanceDrop<A, B>, OppositeOnDrop: HandleImbalanceDrop<A, B>,