Struct scrypto::blueprints::resource::VaultFreezeFlags
source · pub struct VaultFreezeFlags {
bits: u32,
}
Fields§
§bits: u32
Implementations§
source§impl VaultFreezeFlags
impl VaultFreezeFlags
pub const WITHDRAW: VaultFreezeFlags = _
pub const DEPOSIT: VaultFreezeFlags = _
pub const BURN: VaultFreezeFlags = _
sourcepub const fn empty() -> VaultFreezeFlags
pub const fn empty() -> VaultFreezeFlags
Returns an empty set of flags.
sourcepub const fn all() -> VaultFreezeFlags
pub const fn all() -> VaultFreezeFlags
Returns the set containing all flags.
sourcepub const fn from_bits(bits: u32) -> Option<VaultFreezeFlags>
pub const fn from_bits(bits: u32) -> Option<VaultFreezeFlags>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
sourcepub const fn from_bits_truncate(bits: u32) -> VaultFreezeFlags
pub const fn from_bits_truncate(bits: u32) -> VaultFreezeFlags
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
sourcepub const unsafe fn from_bits_unchecked(bits: u32) -> VaultFreezeFlags
pub const unsafe fn from_bits_unchecked(bits: u32) -> VaultFreezeFlags
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: VaultFreezeFlags) -> bool
pub const fn intersects(&self, other: VaultFreezeFlags) -> bool
Returns true
if there are flags common to both self
and other
.
sourcepub const fn contains(&self, other: VaultFreezeFlags) -> bool
pub const fn contains(&self, other: VaultFreezeFlags) -> bool
Returns true
if all of the flags in other
are contained within self
.
sourcepub fn insert(&mut self, other: VaultFreezeFlags)
pub fn insert(&mut self, other: VaultFreezeFlags)
Inserts the specified flags in-place.
sourcepub fn remove(&mut self, other: VaultFreezeFlags)
pub fn remove(&mut self, other: VaultFreezeFlags)
Removes the specified flags in-place.
sourcepub fn toggle(&mut self, other: VaultFreezeFlags)
pub fn toggle(&mut self, other: VaultFreezeFlags)
Toggles the specified flags in-place.
sourcepub fn set(&mut self, other: VaultFreezeFlags, value: bool)
pub fn set(&mut self, other: VaultFreezeFlags, value: bool)
Inserts or removes the specified flags depending on the passed value.
sourcepub const fn intersection(self, other: VaultFreezeFlags) -> VaultFreezeFlags
pub const fn intersection(self, other: VaultFreezeFlags) -> VaultFreezeFlags
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: VaultFreezeFlags) -> VaultFreezeFlags
pub const fn union(self, other: VaultFreezeFlags) -> VaultFreezeFlags
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: VaultFreezeFlags) -> VaultFreezeFlags
pub const fn difference(self, other: VaultFreezeFlags) -> VaultFreezeFlags
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: VaultFreezeFlags
) -> VaultFreezeFlags
pub const fn symmetric_difference( self, other: VaultFreezeFlags ) -> VaultFreezeFlags
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) -> VaultFreezeFlags
pub const fn complement(self) -> VaultFreezeFlags
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
.
Trait Implementations§
source§impl Binary for VaultFreezeFlags
impl Binary for VaultFreezeFlags
source§impl BitAnd for VaultFreezeFlags
impl BitAnd for VaultFreezeFlags
source§fn bitand(self, other: VaultFreezeFlags) -> VaultFreezeFlags
fn bitand(self, other: VaultFreezeFlags) -> VaultFreezeFlags
Returns the intersection between the two sets of flags.
§type Output = VaultFreezeFlags
type Output = VaultFreezeFlags
&
operator.source§impl BitAndAssign for VaultFreezeFlags
impl BitAndAssign for VaultFreezeFlags
source§fn bitand_assign(&mut self, other: VaultFreezeFlags)
fn bitand_assign(&mut self, other: VaultFreezeFlags)
Disables all flags disabled in the set.
source§impl BitOr for VaultFreezeFlags
impl BitOr for VaultFreezeFlags
source§fn bitor(self, other: VaultFreezeFlags) -> VaultFreezeFlags
fn bitor(self, other: VaultFreezeFlags) -> VaultFreezeFlags
Returns the union of the two sets of flags.
§type Output = VaultFreezeFlags
type Output = VaultFreezeFlags
|
operator.source§impl BitOrAssign for VaultFreezeFlags
impl BitOrAssign for VaultFreezeFlags
source§fn bitor_assign(&mut self, other: VaultFreezeFlags)
fn bitor_assign(&mut self, other: VaultFreezeFlags)
Adds the set of flags.
source§impl BitXor for VaultFreezeFlags
impl BitXor for VaultFreezeFlags
source§fn bitxor(self, other: VaultFreezeFlags) -> VaultFreezeFlags
fn bitxor(self, other: VaultFreezeFlags) -> VaultFreezeFlags
Returns the left flags, but with all the right flags toggled.
§type Output = VaultFreezeFlags
type Output = VaultFreezeFlags
^
operator.source§impl BitXorAssign for VaultFreezeFlags
impl BitXorAssign for VaultFreezeFlags
source§fn bitxor_assign(&mut self, other: VaultFreezeFlags)
fn bitxor_assign(&mut self, other: VaultFreezeFlags)
Toggles the set of flags.
source§impl<X> Categorize<X> for VaultFreezeFlagswhere
X: CustomValueKind,
impl<X> Categorize<X> for VaultFreezeFlagswhere
X: CustomValueKind,
fn value_kind() -> ValueKind<X>
source§impl Clone for VaultFreezeFlags
impl Clone for VaultFreezeFlags
source§fn clone(&self) -> VaultFreezeFlags
fn clone(&self) -> VaultFreezeFlags
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for VaultFreezeFlags
impl Debug for VaultFreezeFlags
source§impl<D, X> Decode<X, D> for VaultFreezeFlagswhere
D: Decoder<X>,
X: CustomValueKind,
impl<D, X> Decode<X, D> for VaultFreezeFlagswhere
D: Decoder<X>,
X: CustomValueKind,
source§fn decode_body_with_value_kind(
decoder: &mut D,
value_kind: ValueKind<X>
) -> Result<VaultFreezeFlags, DecodeError>
fn decode_body_with_value_kind( decoder: &mut D, value_kind: ValueKind<X> ) -> Result<VaultFreezeFlags, DecodeError>
source§impl<C> Describe<C> for VaultFreezeFlagswhere
C: CustomTypeKind<RustTypeId>,
impl<C> Describe<C> for VaultFreezeFlagswhere
C: CustomTypeKind<RustTypeId>,
source§const TYPE_ID: RustTypeId = _
const TYPE_ID: RustTypeId = _
TYPE_ID
should give a unique identifier for its SBOR schema type.
An SBOR schema type capture details about the SBOR payload, how it should be interpreted, validated and displayed. Read moresource§fn type_data() -> TypeData<C, RustTypeId>
fn type_data() -> TypeData<C, RustTypeId>
source§fn add_all_dependencies(aggregator: &mut TypeAggregator<C>)
fn add_all_dependencies(aggregator: &mut TypeAggregator<C>)
get_local_type_data
, we need to ensure that the type and all of its own references
get added to the aggregator. Read moresource§impl<E, X> Encode<X, E> for VaultFreezeFlagswhere
E: Encoder<X>,
X: CustomValueKind,
impl<E, X> Encode<X, E> for VaultFreezeFlagswhere
E: Encoder<X>,
X: CustomValueKind,
source§fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>
fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>
source§fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>
fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>
source§impl Extend<VaultFreezeFlags> for VaultFreezeFlags
impl Extend<VaultFreezeFlags> for VaultFreezeFlags
source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = VaultFreezeFlags>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = VaultFreezeFlags>,
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)source§impl FromIterator<VaultFreezeFlags> for VaultFreezeFlags
impl FromIterator<VaultFreezeFlags> for VaultFreezeFlags
source§fn from_iter<T>(iterator: T) -> VaultFreezeFlagswhere
T: IntoIterator<Item = VaultFreezeFlags>,
fn from_iter<T>(iterator: T) -> VaultFreezeFlagswhere
T: IntoIterator<Item = VaultFreezeFlags>,
source§impl Hash for VaultFreezeFlags
impl Hash for VaultFreezeFlags
source§impl LowerHex for VaultFreezeFlags
impl LowerHex for VaultFreezeFlags
source§impl Not for VaultFreezeFlags
impl Not for VaultFreezeFlags
source§fn not(self) -> VaultFreezeFlags
fn not(self) -> VaultFreezeFlags
Returns the complement of this set of flags.
§type Output = VaultFreezeFlags
type Output = VaultFreezeFlags
!
operator.source§impl Octal for VaultFreezeFlags
impl Octal for VaultFreezeFlags
source§impl Ord for VaultFreezeFlags
impl Ord for VaultFreezeFlags
source§fn cmp(&self, other: &VaultFreezeFlags) -> Ordering
fn cmp(&self, other: &VaultFreezeFlags) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for VaultFreezeFlags
impl PartialEq for VaultFreezeFlags
source§fn eq(&self, other: &VaultFreezeFlags) -> bool
fn eq(&self, other: &VaultFreezeFlags) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for VaultFreezeFlags
impl PartialOrd for VaultFreezeFlags
source§fn partial_cmp(&self, other: &VaultFreezeFlags) -> Option<Ordering>
fn partial_cmp(&self, other: &VaultFreezeFlags) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<X> SborTuple<X> for VaultFreezeFlagswhere
X: CustomValueKind,
impl<X> SborTuple<X> for VaultFreezeFlagswhere
X: CustomValueKind,
fn get_length(&self) -> usize
source§impl Sub for VaultFreezeFlags
impl Sub for VaultFreezeFlags
source§fn sub(self, other: VaultFreezeFlags) -> VaultFreezeFlags
fn sub(self, other: VaultFreezeFlags) -> VaultFreezeFlags
Returns the set difference of the two sets of flags.
§type Output = VaultFreezeFlags
type Output = VaultFreezeFlags
-
operator.source§impl SubAssign for VaultFreezeFlags
impl SubAssign for VaultFreezeFlags
source§fn sub_assign(&mut self, other: VaultFreezeFlags)
fn sub_assign(&mut self, other: VaultFreezeFlags)
Disables all flags enabled in the set.
source§impl UpperHex for VaultFreezeFlags
impl UpperHex for VaultFreezeFlags
impl Copy for VaultFreezeFlags
impl Eq for VaultFreezeFlags
impl StructuralPartialEq for VaultFreezeFlags
Auto Trait Implementations§
impl RefUnwindSafe for VaultFreezeFlags
impl Send for VaultFreezeFlags
impl Sync for VaultFreezeFlags
impl Unpin for VaultFreezeFlags
impl UnwindSafe for VaultFreezeFlags
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moresource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.