Struct move_ir_types::ast::ModuleDefinition
source · pub struct ModuleDefinition {
pub identifier: ModuleIdent,
pub friends: Vec<ModuleIdent>,
pub imports: Vec<ImportDefinition>,
pub explicit_dependency_declarations: Vec<ModuleDependency>,
pub structs: Vec<StructDefinition>,
pub constants: Vec<Constant>,
pub functions: Vec<(FunctionName, Function)>,
pub synthetics: Vec<SyntheticDefinition>,
}
Expand description
A Move module
Fields§
§identifier: ModuleIdent
name and address of the module
friends: Vec<ModuleIdent>
the module’s friends
imports: Vec<ImportDefinition>
the module’s dependencies
explicit_dependency_declarations: Vec<ModuleDependency>
Explicit declaration of dependencies. If not provided, will be inferred based on given dependencies to the IR compiler
structs: Vec<StructDefinition>
the structs (including resources) that the module defines
constants: Vec<Constant>
the constants that the script defines. Only a utility, the identifiers are not carried into the Move bytecode
functions: Vec<(FunctionName, Function)>
the procedure that the module defines
synthetics: Vec<SyntheticDefinition>
the synthetic, specification variables the module defines.
Implementations§
source§impl ModuleDefinition
impl ModuleDefinition
sourcepub fn new(
identifier: ModuleIdent,
friends: Vec<ModuleIdent>,
imports: Vec<ImportDefinition>,
explicit_dependency_declarations: Vec<ModuleDependency>,
structs: Vec<StructDefinition>,
constants: Vec<Constant>,
functions: Vec<(FunctionName, Function)>,
synthetics: Vec<SyntheticDefinition>
) -> Self
pub fn new( identifier: ModuleIdent, friends: Vec<ModuleIdent>, imports: Vec<ImportDefinition>, explicit_dependency_declarations: Vec<ModuleDependency>, structs: Vec<StructDefinition>, constants: Vec<Constant>, functions: Vec<(FunctionName, Function)>, synthetics: Vec<SyntheticDefinition> ) -> Self
Creates a new ModuleDefinition
from its string name, dependencies, structs+resources,
and procedures
Does not verify the correctness of any internal properties of its elements
sourcepub fn get_external_deps(&self) -> Vec<ModuleId> ⓘ
pub fn get_external_deps(&self) -> Vec<ModuleId> ⓘ
Return a vector of ModuleId
for the external dependencies.
Trait Implementations§
source§impl Clone for ModuleDefinition
impl Clone for ModuleDefinition
source§fn clone(&self) -> ModuleDefinition
fn clone(&self) -> ModuleDefinition
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 moresource§impl Debug for ModuleDefinition
impl Debug for ModuleDefinition
source§impl Display for ModuleDefinition
impl Display for ModuleDefinition
source§impl PartialEq<ModuleDefinition> for ModuleDefinition
impl PartialEq<ModuleDefinition> for ModuleDefinition
source§fn eq(&self, other: &ModuleDefinition) -> bool
fn eq(&self, other: &ModuleDefinition) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.