Struct frame_support::traits::WithdrawReasons
source · [−]pub struct WithdrawReasons { /* private fields */ }
Expand description
Reasons for moving funds out of an account.
Implementations
sourceimpl WithdrawReasons
impl WithdrawReasons
sourcepub const TRANSACTION_PAYMENT: Self
pub const TRANSACTION_PAYMENT: Self
In order to pay for (system) transaction costs.
sourcepub const fn from_bits(bits: i8) -> Option<Self>
pub const fn from_bits(bits: i8) -> Option<Self>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
sourcepub const fn from_bits_truncate(bits: i8) -> Self
pub const fn from_bits_truncate(bits: i8) -> Self
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
sourcepub const unsafe fn from_bits_unchecked(bits: i8) -> Self
pub const unsafe fn from_bits_unchecked(bits: i8) -> Self
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
Safety
The caller of the bitflags!
macro can chose to allow or
disallow extra bits for their bitflags type.
The caller of from_bits_unchecked()
has to ensure that
all bits correspond to a defined flag or that extra bits
are valid for this bitflags type.
sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Returns true
if there are flags common to both self
and other
.
sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Returns true
if all of the flags in other
are contained within self
.
sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Inserts or removes the specified flags depending on the passed value.
sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
Returns the intersection between the flags in self
and
other
.
Specifically, the returned set contains only the flags which are
present in both self
and other
.
This is equivalent to using the &
operator (e.g.
ops::BitAnd
), as in flags & other
.
sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
Returns the union of between the flags in self
and other
.
Specifically, the returned set contains all flags which are
present in either self
or other
, including any which are
present in both (see Self::symmetric_difference
if that
is undesirable).
This is equivalent to using the |
operator (e.g.
ops::BitOr
), as in flags | other
.
sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
Returns the difference between the flags in self
and other
.
Specifically, the returned set contains all flags present in
self
, except for the ones present in other
.
It is also conceptually equivalent to the “bit-clear” operation:
flags & !other
(and this syntax is also supported).
This is equivalent to using the -
operator (e.g.
ops::Sub
), as in flags - other
.
sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
Returns the symmetric difference between the flags
in self
and other
.
Specifically, the returned set contains the flags present which
are present in self
or other
, but that are not present in
both. Equivalently, it contains the flags present in exactly
one of the sets self
and other
.
This is equivalent to using the ^
operator (e.g.
ops::BitXor
), as in flags ^ other
.
sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
Returns the complement of this set of flags.
Specifically, the returned set contains all the flags which are
not set in self
, but which are allowed for this type.
Alternatively, it can be thought of as the set difference
between Self::all()
and self
(e.g. Self::all() - self
)
This is equivalent to using the !
operator (e.g.
ops::Not
), as in !flags
.
sourceimpl WithdrawReasons
impl WithdrawReasons
sourcepub fn except(one: WithdrawReasons) -> WithdrawReasons
pub fn except(one: WithdrawReasons) -> WithdrawReasons
Choose all variants except for one
.
assert_eq!(
WithdrawReasons::FEE | WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE | WithdrawReasons::TIP,
WithdrawReasons::except(WithdrawReasons::TRANSACTION_PAYMENT),
);
Trait Implementations
sourceimpl Binary for WithdrawReasons
impl Binary for WithdrawReasons
sourceimpl BitAnd<WithdrawReasons> for WithdrawReasons
impl BitAnd<WithdrawReasons> for WithdrawReasons
sourceimpl BitAndAssign<WithdrawReasons> for WithdrawReasons
impl BitAndAssign<WithdrawReasons> for WithdrawReasons
sourcefn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
Disables all flags disabled in the set.
sourceimpl BitOr<WithdrawReasons> for WithdrawReasons
impl BitOr<WithdrawReasons> for WithdrawReasons
sourcefn bitor(self, other: WithdrawReasons) -> Self
fn bitor(self, other: WithdrawReasons) -> Self
Returns the union of the two sets of flags.
type Output = Self
type Output = Self
The resulting type after applying the |
operator.
sourceimpl BitOrAssign<WithdrawReasons> for WithdrawReasons
impl BitOrAssign<WithdrawReasons> for WithdrawReasons
sourcefn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Adds the set of flags.
sourceimpl BitXor<WithdrawReasons> for WithdrawReasons
impl BitXor<WithdrawReasons> for WithdrawReasons
sourceimpl BitXorAssign<WithdrawReasons> for WithdrawReasons
impl BitXorAssign<WithdrawReasons> for WithdrawReasons
sourcefn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
Toggles the set of flags.
sourceimpl Clone for WithdrawReasons
impl Clone for WithdrawReasons
sourcefn clone(&self) -> WithdrawReasons
fn clone(&self) -> WithdrawReasons
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for WithdrawReasons
impl Debug for WithdrawReasons
sourceimpl Decode for WithdrawReasons
impl Decode for WithdrawReasons
sourcefn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
Attempt to deserialise the value from input.
sourcefn skip<I>(input: &mut I) -> Result<(), Error> where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error> where
I: Input,
Attempt to skip the encoded value from input. Read more
sourcefn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
sourceimpl Encode for WithdrawReasons
impl Encode for WithdrawReasons
sourcefn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
Convert self to a slice and append it to the destination.
sourcefn encode(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn encode(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Convert self to an owned vector.
sourcefn using_encoded<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R
fn using_encoded<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
sourcefn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
sourcefn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
sourceimpl Extend<WithdrawReasons> for WithdrawReasons
impl Extend<WithdrawReasons> for WithdrawReasons
sourcefn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl FromIterator<WithdrawReasons> for WithdrawReasons
impl FromIterator<WithdrawReasons> for WithdrawReasons
sourcefn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
Creates a value from an iterator. Read more
sourceimpl Hash for WithdrawReasons
impl Hash for WithdrawReasons
sourceimpl LowerHex for WithdrawReasons
impl LowerHex for WithdrawReasons
sourceimpl Not for WithdrawReasons
impl Not for WithdrawReasons
sourceimpl Octal for WithdrawReasons
impl Octal for WithdrawReasons
sourceimpl Ord for WithdrawReasons
impl Ord for WithdrawReasons
sourceimpl PartialEq<WithdrawReasons> for WithdrawReasons
impl PartialEq<WithdrawReasons> for WithdrawReasons
sourcefn eq(&self, other: &WithdrawReasons) -> bool
fn eq(&self, other: &WithdrawReasons) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &WithdrawReasons) -> bool
fn ne(&self, other: &WithdrawReasons) -> bool
This method tests for !=
.
sourceimpl PartialOrd<WithdrawReasons> for WithdrawReasons
impl PartialOrd<WithdrawReasons> for WithdrawReasons
sourcefn partial_cmp(&self, other: &WithdrawReasons) -> Option<Ordering>
fn partial_cmp(&self, other: &WithdrawReasons) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Sub<WithdrawReasons> for WithdrawReasons
impl Sub<WithdrawReasons> for WithdrawReasons
sourceimpl SubAssign<WithdrawReasons> for WithdrawReasons
impl SubAssign<WithdrawReasons> for WithdrawReasons
sourcefn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Disables all flags enabled in the set.
sourceimpl UpperHex for WithdrawReasons
impl UpperHex for WithdrawReasons
impl Copy for WithdrawReasons
impl EncodeLike<WithdrawReasons> for WithdrawReasons
impl Eq for WithdrawReasons
impl StructuralEq for WithdrawReasons
impl StructuralPartialEq for WithdrawReasons
Auto Trait Implementations
impl RefUnwindSafe for WithdrawReasons
impl Send for WithdrawReasons
impl Sync for WithdrawReasons
impl Unpin for WithdrawReasons
impl UnwindSafe for WithdrawReasons
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallHasher for T where
T: Hash,
impl<T> CallHasher for T where
T: Hash,
sourceimpl<T> CallHasher for T where
T: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash + ?Sized,
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>,
Convert from a value of T
into an equivalent instance of Option<Self>
. Read more
sourcefn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
Consume self to return Some
equivalent value of Option<T>
. Read more
sourceimpl<T> DecodeLimit for T where
T: Decode,
impl<T> DecodeLimit for T where
T: Decode,
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
sourceimpl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
sourcefn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
Convert from a value of T
into an equivalent instance of Self
. Read more
sourcefn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of T
. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
sourcepub fn unchecked_into(self) -> T
pub fn unchecked_into(self) -> T
The counterpart to unchecked_from
.
sourceimpl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
sourcepub fn unique_saturated_into(self) -> T
pub fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of T
.