pub struct Flags { /* private fields */ }Expand description
Bitfield representation of asset flags.
Implementations§
Source§impl Flags
impl Flags
Sourcepub const fn into_bytes(self) -> [u8; 1]
pub const fn into_bytes(self) -> [u8; 1]
Sourcepub const fn from_bytes(bytes: [u8; 1]) -> Self
pub const fn from_bytes(bytes: [u8; 1]) -> Self
Converts the given bytes directly into the bitfield struct.
Source§impl Flags
impl Flags
Sourcepub fn asset_lvl_frozen(&self) -> <bool as Specifier>::InOut
pub fn asset_lvl_frozen(&self) -> <bool as Specifier>::InOut
Returns the value of asset_lvl_frozen. Frozen at the asset level by the leaf delegate.
Sourcepub fn asset_lvl_frozen_or_err(
&self,
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
pub fn asset_lvl_frozen_or_err( &self, ) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of asset_lvl_frozen.
#Errors
If the returned value contains an invalid bit pattern for asset_lvl_frozen. Frozen at the asset level by the leaf delegate.
Sourcepub fn with_asset_lvl_frozen(self, new_val: <bool as Specifier>::InOut) -> Self
pub fn with_asset_lvl_frozen(self, new_val: <bool as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of asset_lvl_frozen set to the given value.
#Panics
If the given value is out of bounds for asset_lvl_frozen. Frozen at the asset level by the leaf delegate.
Sourcepub fn with_asset_lvl_frozen_checked(
self,
new_val: <bool as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_asset_lvl_frozen_checked( self, new_val: <bool as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of asset_lvl_frozen set to the given value.
#Errors
If the given value is out of bounds for asset_lvl_frozen. Frozen at the asset level by the leaf delegate.
Sourcepub fn set_asset_lvl_frozen(&mut self, new_val: <bool as Specifier>::InOut)
pub fn set_asset_lvl_frozen(&mut self, new_val: <bool as Specifier>::InOut)
Sets the value of asset_lvl_frozen to the given value.
#Panics
If the given value is out of bounds for asset_lvl_frozen. Frozen at the asset level by the leaf delegate.
Sourcepub fn set_asset_lvl_frozen_checked(
&mut self,
new_val: <bool as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_asset_lvl_frozen_checked( &mut self, new_val: <bool as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of asset_lvl_frozen to the given value.
#Errors
If the given value is out of bounds for asset_lvl_frozen. Frozen at the asset level by the leaf delegate.
Sourcepub fn permanent_lvl_frozen(&self) -> <bool as Specifier>::InOut
pub fn permanent_lvl_frozen(&self) -> <bool as Specifier>::InOut
Returns the value of permanent_lvl_frozen. Frozen by the mpl-core collection permanent freeze delegate.
Sourcepub fn permanent_lvl_frozen_or_err(
&self,
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
pub fn permanent_lvl_frozen_or_err( &self, ) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of permanent_lvl_frozen.
#Errors
If the returned value contains an invalid bit pattern for permanent_lvl_frozen. Frozen by the mpl-core collection permanent freeze delegate.
Sourcepub fn with_permanent_lvl_frozen(
self,
new_val: <bool as Specifier>::InOut,
) -> Self
pub fn with_permanent_lvl_frozen( self, new_val: <bool as Specifier>::InOut, ) -> Self
Returns a copy of the bitfield with the value of permanent_lvl_frozen set to the given value.
#Panics
If the given value is out of bounds for permanent_lvl_frozen. Frozen by the mpl-core collection permanent freeze delegate.
Sourcepub fn with_permanent_lvl_frozen_checked(
self,
new_val: <bool as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_permanent_lvl_frozen_checked( self, new_val: <bool as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of permanent_lvl_frozen set to the given value.
#Errors
If the given value is out of bounds for permanent_lvl_frozen. Frozen by the mpl-core collection permanent freeze delegate.
Sourcepub fn set_permanent_lvl_frozen(&mut self, new_val: <bool as Specifier>::InOut)
pub fn set_permanent_lvl_frozen(&mut self, new_val: <bool as Specifier>::InOut)
Sets the value of permanent_lvl_frozen to the given value.
#Panics
If the given value is out of bounds for permanent_lvl_frozen. Frozen by the mpl-core collection permanent freeze delegate.
Sourcepub fn set_permanent_lvl_frozen_checked(
&mut self,
new_val: <bool as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_permanent_lvl_frozen_checked( &mut self, new_val: <bool as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of permanent_lvl_frozen to the given value.
#Errors
If the given value is out of bounds for permanent_lvl_frozen. Frozen by the mpl-core collection permanent freeze delegate.
Sourcepub fn non_transferable(&self) -> <bool as Specifier>::InOut
pub fn non_transferable(&self) -> <bool as Specifier>::InOut
Returns the value of non_transferable. Set to permanently non-transferable (soulbound).
Sourcepub fn non_transferable_or_err(
&self,
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
pub fn non_transferable_or_err( &self, ) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of non_transferable.
#Errors
If the returned value contains an invalid bit pattern for non_transferable. Set to permanently non-transferable (soulbound).
Sourcepub fn with_non_transferable(self, new_val: <bool as Specifier>::InOut) -> Self
pub fn with_non_transferable(self, new_val: <bool as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of non_transferable set to the given value.
#Panics
If the given value is out of bounds for non_transferable. Set to permanently non-transferable (soulbound).
Sourcepub fn with_non_transferable_checked(
self,
new_val: <bool as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_non_transferable_checked( self, new_val: <bool as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of non_transferable set to the given value.
#Errors
If the given value is out of bounds for non_transferable. Set to permanently non-transferable (soulbound).
Sourcepub fn set_non_transferable(&mut self, new_val: <bool as Specifier>::InOut)
pub fn set_non_transferable(&mut self, new_val: <bool as Specifier>::InOut)
Sets the value of non_transferable to the given value.
#Panics
If the given value is out of bounds for non_transferable. Set to permanently non-transferable (soulbound).
Sourcepub fn set_non_transferable_checked(
&mut self,
new_val: <bool as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_non_transferable_checked( &mut self, new_val: <bool as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of non_transferable to the given value.
#Errors
If the given value is out of bounds for non_transferable. Set to permanently non-transferable (soulbound).
Sourcepub fn empty_bits(&self) -> <B5 as Specifier>::InOut
pub fn empty_bits(&self) -> <B5 as Specifier>::InOut
Returns the value of empty_bits. Unused flags for future asset-level usage.
Sourcepub fn empty_bits_or_err(
&self,
) -> Result<<B5 as Specifier>::InOut, InvalidBitPattern<<B5 as Specifier>::Bytes>>
pub fn empty_bits_or_err( &self, ) -> Result<<B5 as Specifier>::InOut, InvalidBitPattern<<B5 as Specifier>::Bytes>>
Returns the value of empty_bits.
#Errors
If the returned value contains an invalid bit pattern for empty_bits. Unused flags for future asset-level usage.
Sourcepub fn with_empty_bits(self, new_val: <B5 as Specifier>::InOut) -> Self
pub fn with_empty_bits(self, new_val: <B5 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of empty_bits set to the given value.
#Panics
If the given value is out of bounds for empty_bits. Unused flags for future asset-level usage.
Sourcepub fn with_empty_bits_checked(
self,
new_val: <B5 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_empty_bits_checked( self, new_val: <B5 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of empty_bits set to the given value.
#Errors
If the given value is out of bounds for empty_bits. Unused flags for future asset-level usage.
Sourcepub fn set_empty_bits(&mut self, new_val: <B5 as Specifier>::InOut)
pub fn set_empty_bits(&mut self, new_val: <B5 as Specifier>::InOut)
Sets the value of empty_bits to the given value.
#Panics
If the given value is out of bounds for empty_bits. Unused flags for future asset-level usage.
Sourcepub fn set_empty_bits_checked(
&mut self,
new_val: <B5 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_empty_bits_checked( &mut self, new_val: <B5 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of empty_bits to the given value.
#Errors
If the given value is out of bounds for empty_bits. Unused flags for future asset-level usage.