Struct move_binary_format::file_format::StructHandle
source · pub struct StructHandle {
pub module: ModuleHandleIndex,
pub name: IdentifierIndex,
pub abilities: AbilitySet,
pub type_parameters: Vec<StructTypeParameter>,
}
Expand description
A StructHandle
is a reference to a user defined type. It is composed by a ModuleHandle
and the name of the type within that module.
A type in a module is uniquely identified by its name and as such the name is enough to perform resolution.
The StructHandle
is polymorphic: it can have type parameters in its fields and carries the
ability constraints for these type parameters (empty list for non-generic structs). It also
carries the abilities of the struct itself so that the verifier can check
ability semantics without having to load the referenced type.
At link time ability/constraint checking is performed and an error is reported if there is a mismatch with the definition.
Fields§
§module: ModuleHandleIndex
The module that defines the type.
name: IdentifierIndex
The name of the type.
abilities: AbilitySet
Contains the abilities for this struct For any instantiation of this type, the abilities of this type are predicated on that ability being satisfied for all type parameters.
type_parameters: Vec<StructTypeParameter>
The type formals (identified by their index into the vec)
Implementations§
source§impl StructHandle
impl StructHandle
pub fn type_param_constraints( &self ) -> impl ExactSizeIterator<Item = AbilitySet> + '_
Trait Implementations§
source§impl Arbitrary for StructHandle
impl Arbitrary for StructHandle
§type Parameters = ()
type Parameters = ()
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = Map<(<ModuleHandleIndex as Arbitrary>::Strategy, <IdentifierIndex as Arbitrary>::Strategy, <AbilitySet as Arbitrary>::Strategy, <Vec<StructTypeParameter, Global> as Arbitrary>::Strategy), fn(_: (ModuleHandleIndex, IdentifierIndex, AbilitySet, Vec<StructTypeParameter, Global>)) -> StructHandle>
type Strategy = Map<(<ModuleHandleIndex as Arbitrary>::Strategy, <IdentifierIndex as Arbitrary>::Strategy, <AbilitySet as Arbitrary>::Strategy, <Vec<StructTypeParameter, Global> as Arbitrary>::Strategy), fn(_: (ModuleHandleIndex, IdentifierIndex, AbilitySet, Vec<StructTypeParameter, Global>)) -> StructHandle>
Strategy
used to generate values of type Self
.source§fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
source§impl Clone for StructHandle
impl Clone for StructHandle
source§fn clone(&self) -> StructHandle
fn clone(&self) -> StructHandle
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for StructHandle
impl Debug for StructHandle
source§impl Hash for StructHandle
impl Hash for StructHandle
source§impl Ord for StructHandle
impl Ord for StructHandle
source§fn cmp(&self, other: &StructHandle) -> Ordering
fn cmp(&self, other: &StructHandle) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<StructHandle> for StructHandle
impl PartialEq<StructHandle> for StructHandle
source§fn eq(&self, other: &StructHandle) -> bool
fn eq(&self, other: &StructHandle) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<StructHandle> for StructHandle
impl PartialOrd<StructHandle> for StructHandle
source§fn partial_cmp(&self, other: &StructHandle) -> Option<Ordering>
fn partial_cmp(&self, other: &StructHandle) -> 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 more