Struct move_ir_types::ast::Function_
source · pub struct Function_ {
pub visibility: FunctionVisibility,
pub signature: FunctionSignature,
pub acquires: Vec<StructName>,
pub specifications: Vec<Condition>,
pub body: FunctionBody,
}
Expand description
A Move function/procedure
Fields§
§visibility: FunctionVisibility
The visibility
signature: FunctionSignature
The type signature
acquires: Vec<StructName>
List of nominal resources (declared in this module) that the procedure might access Either through: BorrowGlobal, MoveFrom, or transitively through another procedure This list of acquires grants the borrow checker the ability to statically verify the safety of references into global storage
specifications: Vec<Condition>
List of specifications for the Move prover (experimental)
body: FunctionBody
The code for the procedure
Implementations§
source§impl Function_
impl Function_
sourcepub fn new(
visibility: FunctionVisibility,
formals: Vec<(Var, Type)>,
return_type: Vec<Type>,
type_parameters: Vec<(TypeVar, BTreeSet<Ability>)>,
acquires: Vec<StructName>,
specifications: Vec<Condition>,
body: FunctionBody
) -> Self
pub fn new( visibility: FunctionVisibility, formals: Vec<(Var, Type)>, return_type: Vec<Type>, type_parameters: Vec<(TypeVar, BTreeSet<Ability>)>, acquires: Vec<StructName>, specifications: Vec<Condition>, body: FunctionBody ) -> Self
Creates a new function declaration from the components of the function
See the declaration of the struct Function
for more details