Enum frame_support::traits::tokens::WithdrawConsequence
source · pub enum WithdrawConsequence<Balance> {
NoFunds,
WouldDie,
UnknownAsset,
Underflow,
Overflow,
Frozen,
ReducedToZero(Balance),
Success,
}
Expand description
One of a number of consequences of withdrawing a fungible from an account.
Variants
NoFunds
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
sourceimpl<Balance: Zero> WithdrawConsequence<Balance>
impl<Balance: Zero> WithdrawConsequence<Balance>
sourcepub fn into_result(self) -> Result<Balance, DispatchError>
pub fn into_result(self) -> 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
sourceimpl<Balance: Clone> Clone for WithdrawConsequence<Balance>
impl<Balance: Clone> Clone for WithdrawConsequence<Balance>
sourcefn clone(&self) -> WithdrawConsequence<Balance>
fn clone(&self) -> WithdrawConsequence<Balance>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl<Balance> Debug for WithdrawConsequence<Balance>where
Balance: Debug,
impl<Balance> Debug for WithdrawConsequence<Balance>where
Balance: Debug,
sourceimpl<Balance: PartialEq> PartialEq<WithdrawConsequence<Balance>> for WithdrawConsequence<Balance>
impl<Balance: PartialEq> PartialEq<WithdrawConsequence<Balance>> for WithdrawConsequence<Balance>
sourcefn eq(&self, other: &WithdrawConsequence<Balance>) -> bool
fn eq(&self, other: &WithdrawConsequence<Balance>) -> bool
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> CheckedConversion for T
impl<T> CheckedConversion for T
sourcefn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
sourcefn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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 morefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read morefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read morefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read moresourceimpl<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,
sourcefn 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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<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
sourceimpl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
sourcefn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
sourcefn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read moresourceimpl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
sourcefn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.sourceimpl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
sourcefn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.