Struct move_model::model::StructEnv
source · pub struct StructEnv<'env> {
pub module_env: ModuleEnv<'env>,
/* private fields */
}
Fields§
§module_env: ModuleEnv<'env>
Reference to enclosing module.
Implementations§
source§impl<'env> StructEnv<'env>
impl<'env> StructEnv<'env>
sourcepub fn get_full_name_str(&self) -> String
pub fn get_full_name_str(&self) -> String
Gets full name as string.
sourcepub fn get_identifier(&self) -> Identifier
pub fn get_identifier(&self) -> Identifier
Returns the VM identifier for this struct
sourcepub fn symbol_pool(&self) -> &SymbolPool
pub fn symbol_pool(&self) -> &SymbolPool
Shortcut for accessing the symbol pool.
sourcepub fn get_properties(&self) -> &PropertyBag
pub fn get_properties(&self) -> &PropertyBag
Returns properties from pragmas.
sourcepub fn get_qualified_id(&self) -> QualifiedId<StructId>
pub fn get_qualified_id(&self) -> QualifiedId<StructId>
Gets the qualified id of this struct.
sourcepub fn get_abilities(&self) -> AbilitySet
pub fn get_abilities(&self) -> AbilitySet
Get the abilities of this struct.
sourcepub fn has_memory(&self) -> bool
pub fn has_memory(&self) -> bool
Determines whether memory-related operations needs to be declared for this struct.
sourcepub fn get_fields(&'env self) -> impl Iterator<Item = FieldEnv<'env>>
pub fn get_fields(&'env self) -> impl Iterator<Item = FieldEnv<'env>>
Get an iterator for the fields, ordered by offset.
sourcepub fn get_field_count(&self) -> usize
pub fn get_field_count(&self) -> usize
Return the number of fields in the struct.
sourcepub fn find_field(&'env self, name: Symbol) -> Option<FieldEnv<'env>>
pub fn find_field(&'env self, name: Symbol) -> Option<FieldEnv<'env>>
Find a field by its name.
sourcepub fn get_field_by_offset(&'env self, offset: usize) -> FieldEnv<'env>
pub fn get_field_by_offset(&'env self, offset: usize) -> FieldEnv<'env>
Gets a field by its offset.
sourcepub fn is_phantom_parameter(&self, idx: usize) -> bool
pub fn is_phantom_parameter(&self, idx: usize) -> bool
Whether the type parameter at position idx
is declared as phantom.
sourcepub fn get_type_parameters(&self) -> Vec<TypeParameter> ⓘ
pub fn get_type_parameters(&self) -> Vec<TypeParameter> ⓘ
Returns the type parameters associated with this struct.
sourcepub fn get_named_type_parameters(&self) -> Vec<TypeParameter> ⓘ
pub fn get_named_type_parameters(&self) -> Vec<TypeParameter> ⓘ
Returns the type parameters associated with this struct, with actual names.
sourcepub fn has_conditions(&self) -> bool
pub fn has_conditions(&self) -> bool
Returns true if this struct has specifcation conditions.
sourcepub fn get_spec(&'env self) -> &'env Spec
pub fn get_spec(&'env self) -> &'env Spec
Returns the data invariants associated with this struct.
sourcepub fn is_pragma_true(&self, name: &str, default: impl FnOnce() -> bool) -> bool
pub fn is_pragma_true(&self, name: &str, default: impl FnOnce() -> bool) -> bool
Returns the value of a boolean pragma for this struct. This first looks up a pragma in this struct, then the enclosing module, and finally uses the provided default. value
sourcepub fn is_native_or_intrinsic(&self) -> bool
pub fn is_native_or_intrinsic(&self) -> bool
Returns true if this struct is native or marked as intrinsic.