Struct move_model::model::AbilitySet
pub struct AbilitySet(_);
Expand description
A set of Ability
s
Implementations§
§impl AbilitySet
impl AbilitySet
pub const EMPTY: AbilitySet = Self(0)
pub const EMPTY: AbilitySet = Self(0)
The empty ability set
pub const PRIMITIVES: AbilitySet = Self(Ability::Copy as u8 | Ability::Drop as u8 | Ability::Store as u8)
pub const PRIMITIVES: AbilitySet = Self(Ability::Copy as u8 | Ability::Drop as u8 | Ability::Store as u8)
Abilities for Bool
, U8
, U64
, U128
, and Address
pub const REFERENCES: AbilitySet = Self(Ability::Copy as u8 | Ability::Drop as u8)
pub const REFERENCES: AbilitySet = Self(Ability::Copy as u8 | Ability::Drop as u8)
Abilities for Reference
and MutableReference
pub const SIGNER: AbilitySet = Self(Ability::Drop as u8)
pub const SIGNER: AbilitySet = Self(Ability::Drop as u8)
Abilities for Signer
pub const VECTOR: AbilitySet = Self(Ability::Copy as u8 | Ability::Drop as u8 | Ability::Store as u8)
pub const VECTOR: AbilitySet = Self(Ability::Copy as u8 | Ability::Drop as u8 | Ability::Store as u8)
Abilities for Vector
, note they are predicated on the type argument
pub const ALL: AbilitySet = Self(Ability::Copy as u8 | Ability::Drop as u8 | Ability::Store as u8 |
Ability::Key as u8)
pub const ALL: AbilitySet = Self(Ability::Copy as u8 | Ability::Drop as u8 | Ability::Store as u8 | Ability::Key as u8)
Ability set containing all abilities
pub fn has_ability(self, ability: Ability) -> bool
pub fn has_copy(self) -> bool
pub fn has_drop(self) -> bool
pub fn has_store(self) -> bool
pub fn has_key(self) -> bool
pub fn remove(self, ability: Ability) -> AbilitySet
pub fn intersect(self, other: AbilitySet) -> AbilitySet
pub fn union(self, other: AbilitySet) -> AbilitySet
pub fn is_subset(self, other: AbilitySet) -> bool
pub fn polymorphic_abilities<I1, I2>(
declared_abilities: AbilitySet,
declared_phantom_parameters: I1,
type_arguments: I2
) -> Result<AbilitySet, PartialVMError>where
I1: IntoIterator<Item = bool>,
I2: IntoIterator<Item = AbilitySet>,
<I1 as IntoIterator>::IntoIter: ExactSizeIterator,
<I2 as IntoIterator>::IntoIter: ExactSizeIterator,
pub fn polymorphic_abilities<I1, I2>( declared_abilities: AbilitySet, declared_phantom_parameters: I1, type_arguments: I2 ) -> Result<AbilitySet, PartialVMError>where I1: IntoIterator<Item = bool>, I2: IntoIterator<Item = AbilitySet>, <I1 as IntoIterator>::IntoIter: ExactSizeIterator, <I2 as IntoIterator>::IntoIter: ExactSizeIterator,
For a polymorphic type, its actual abilities correspond to its declared abilities but
predicated on its non-phantom type arguments having that ability. For Key
, instead of needing
the same ability, the type arguments need Store
.
pub fn from_u8(byte: u8) -> Option<AbilitySet>
pub fn into_u8(self) -> u8
Trait Implementations§
§impl Arbitrary for AbilitySet
impl Arbitrary for AbilitySet
§type Strategy = BoxedStrategy<AbilitySet>
type Strategy = BoxedStrategy<AbilitySet>
The type of
Strategy
used to generate values of type Self
.§type Parameters = ()
type Parameters = ()
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§fn arbitrary_with(
_params: <AbilitySet as Arbitrary>::Parameters
) -> <AbilitySet as Arbitrary>::Strategy
fn arbitrary_with( _params: <AbilitySet as Arbitrary>::Parameters ) -> <AbilitySet as Arbitrary>::Strategy
§impl BitOr<Ability> for AbilitySet
impl BitOr<Ability> for AbilitySet
§type Output = AbilitySet
type Output = AbilitySet
The resulting type after applying the
|
operator.§fn bitor(self, rhs: Ability) -> AbilitySet
fn bitor(self, rhs: Ability) -> AbilitySet
Performs the
|
operation. Read more§impl BitOr<AbilitySet> for AbilitySet
impl BitOr<AbilitySet> for AbilitySet
§type Output = AbilitySet
type Output = AbilitySet
The resulting type after applying the
|
operator.§fn bitor(self, rhs: AbilitySet) -> AbilitySet
fn bitor(self, rhs: AbilitySet) -> AbilitySet
Performs the
|
operation. Read more§impl Clone for AbilitySet
impl Clone for AbilitySet
§fn clone(&self) -> AbilitySet
fn clone(&self) -> AbilitySet
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for AbilitySet
impl Debug for AbilitySet
§impl Hash for AbilitySet
impl Hash for AbilitySet
§impl IntoIterator for AbilitySet
impl IntoIterator for AbilitySet
§fn into_iter(self) -> <AbilitySet as IntoIterator>::IntoIter
fn into_iter(self) -> <AbilitySet as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
§impl Ord for AbilitySet
impl Ord for AbilitySet
§impl PartialEq<AbilitySet> for AbilitySet
impl PartialEq<AbilitySet> for AbilitySet
§fn eq(&self, other: &AbilitySet) -> bool
fn eq(&self, other: &AbilitySet) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl PartialOrd<AbilitySet> for AbilitySet
impl PartialOrd<AbilitySet> for AbilitySet
§fn partial_cmp(&self, other: &AbilitySet) -> Option<Ordering>
fn partial_cmp(&self, other: &AbilitySet) -> Option<Ordering>
1.0.0 · source§fn 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 moreimpl Copy for AbilitySet
impl Eq for AbilitySet
impl StructuralEq for AbilitySet
impl StructuralPartialEq for AbilitySet
Auto Trait Implementations§
impl RefUnwindSafe for AbilitySet
impl Send for AbilitySet
impl Sync for AbilitySet
impl Unpin for AbilitySet
impl UnwindSafe for AbilitySet
Blanket Implementations§
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
Compare self to
key
and return true
if they are equal.