Enum frame_support::traits::tokens::WithdrawConsequence
source · pub enum WithdrawConsequence<Balance> {
BalanceLow,
WouldDie,
UnknownAsset,
Underflow,
Overflow,
Frozen,
ReducedToZero(Balance),
Success,
}
Expand description
One of a number of consequences of withdrawing a fungible from an account.
Variants§
BalanceLow
Withdraw could not happen since the amount to be withdrawn is less than the total funds in the account.
WouldDie
The withdraw would mean the account dying when it needs to exist (usually because it is a provider and there are consumer references on it).
UnknownAsset
The asset is unknown. Usually because an AssetId
has been presented which doesn’t exist
on the system.
Underflow
There has been an underflow in the system. This is indicative of a corrupt state and likely unrecoverable.
Overflow
There has been an overflow in the system. This is indicative of a corrupt state and likely unrecoverable.
Frozen
Not enough of the funds in the account are unavailable for withdrawal.
ReducedToZero(Balance)
Account balance would reduce to zero, potentially destroying it. The parameter is the amount of balance which is destroyed.
Success
Account continued in existence.
Implementations§
source§impl<Balance: Zero> WithdrawConsequence<Balance>
impl<Balance: Zero> WithdrawConsequence<Balance>
sourcepub fn into_result(self, keep_nonzero: bool) -> Result<Balance, DispatchError>
pub fn into_result(self, keep_nonzero: bool) -> Result<Balance, DispatchError>
Convert the type into a Result
with DispatchError
as the error or the additional
Balance
by which the account will be reduced.
Trait Implementations§
source§impl<Balance: Clone> Clone for WithdrawConsequence<Balance>
impl<Balance: Clone> Clone for WithdrawConsequence<Balance>
source§fn clone(&self) -> WithdrawConsequence<Balance>
fn clone(&self) -> WithdrawConsequence<Balance>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<Balance> Debug for WithdrawConsequence<Balance>where
Balance: Debug,
impl<Balance> Debug for WithdrawConsequence<Balance>where Balance: Debug,
source§impl<Balance: PartialEq> PartialEq<WithdrawConsequence<Balance>> for WithdrawConsequence<Balance>
impl<Balance: PartialEq> PartialEq<WithdrawConsequence<Balance>> for WithdrawConsequence<Balance>
source§fn eq(&self, other: &WithdrawConsequence<Balance>) -> bool
fn eq(&self, other: &WithdrawConsequence<Balance>) -> bool
self
and other
values to be equal, and is used
by ==
.impl<Balance: Copy> Copy for WithdrawConsequence<Balance>
impl<Balance: Eq> Eq for WithdrawConsequence<Balance>
impl<Balance> StructuralEq for WithdrawConsequence<Balance>
impl<Balance> StructuralPartialEq for WithdrawConsequence<Balance>
Auto Trait Implementations§
impl<Balance> RefUnwindSafe for WithdrawConsequence<Balance>where Balance: RefUnwindSafe,
impl<Balance> Send for WithdrawConsequence<Balance>where Balance: Send,
impl<Balance> Sync for WithdrawConsequence<Balance>where Balance: Sync,
impl<Balance> Unpin for WithdrawConsequence<Balance>where Balance: Unpin,
impl<Balance> UnwindSafe for WithdrawConsequence<Balance>where Balance: UnwindSafe,
Blanket Implementations§
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
T
. Read moresource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.