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>

source

pub fn get_name(&self) -> Symbol

Returns the name of this struct.

source

pub fn get_full_name_str(&self) -> String

Gets full name as string.

source

pub fn get_identifier(&self) -> Identifier

Returns the VM identifier for this struct

source

pub fn symbol_pool(&self) -> &SymbolPool

Shortcut for accessing the symbol pool.

source

pub fn get_loc(&self) -> Loc

Returns the location of this struct.

source

pub fn get_doc(&self) -> &str

Get documentation associated with this struct.

source

pub fn get_properties(&self) -> &PropertyBag

Returns properties from pragmas.

source

pub fn get_id(&self) -> StructId

Gets the id associated with this struct.

source

pub fn get_qualified_id(&self) -> QualifiedId<StructId>

Gets the qualified id of this struct.

source

pub fn is_native(&self) -> bool

Determines whether this struct is native.

source

pub fn is_vector(&self) -> bool

Determines whether this struct is the well-known vector type.

source

pub fn get_abilities(&self) -> AbilitySet

Get the abilities of this struct.

source

pub fn has_memory(&self) -> bool

Determines whether memory-related operations needs to be declared for this struct.

source

pub fn get_fields(&'env self) -> impl Iterator<Item = FieldEnv<'env>>

Get an iterator for the fields, ordered by offset.

source

pub fn get_field_count(&self) -> usize

Return the number of fields in the struct.

source

pub fn get_field(&'env self, id: FieldId) -> FieldEnv<'env>

Gets a field by its id.

source

pub fn find_field(&'env self, name: Symbol) -> Option<FieldEnv<'env>>

Find a field by its name.

source

pub fn get_field_by_offset(&'env self, offset: usize) -> FieldEnv<'env>

Gets a field by its offset.

source

pub fn is_phantom_parameter(&self, idx: usize) -> bool

Whether the type parameter at position idx is declared as phantom.

source

pub fn get_type_parameters(&self) -> Vec<TypeParameter>

Returns the type parameters associated with this struct.

source

pub fn get_named_type_parameters(&self) -> Vec<TypeParameter>

Returns the type parameters associated with this struct, with actual names.

source

pub fn has_conditions(&self) -> bool

Returns true if this struct has specifcation conditions.

source

pub fn get_spec(&'env self) -> &'env Spec

Returns the data invariants associated with this struct.

source

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

source

pub fn is_native_or_intrinsic(&self) -> bool

Returns true if this struct is native or marked as intrinsic.

Trait Implementations§

source§

impl<'env> Clone for StructEnv<'env>

source§

fn clone(&self) -> StructEnv<'env>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'env> Debug for StructEnv<'env>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'env> !RefUnwindSafe for StructEnv<'env>

§

impl<'env> !Send for StructEnv<'env>

§

impl<'env> !Sync for StructEnv<'env>

§

impl<'env> Unpin for StructEnv<'env>

§

impl<'env> !UnwindSafe for StructEnv<'env>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V