Struct move_binary_format::file_format::CompiledScript
source · pub struct CompiledScript {
pub version: u32,
pub module_handles: Vec<ModuleHandle>,
pub struct_handles: Vec<StructHandle>,
pub function_handles: Vec<FunctionHandle>,
pub function_instantiations: Vec<FunctionInstantiation>,
pub signatures: SignaturePool,
pub identifiers: IdentifierPool,
pub address_identifiers: AddressIdentifierPool,
pub constant_pool: ConstantPool,
pub type_parameters: Vec<AbilitySet>,
pub parameters: SignatureIndex,
pub code: CodeUnit,
}
Expand description
Contains the main function to execute and its dependencies.
A CompiledScript does not have definition tables because it can only have a main(args)
.
A CompiledScript defines the constant pools (string, address, signatures, etc.), the handle
tables (external code references) and it has a main
definition.
Fields§
§version: u32
Version number found during deserialization
module_handles: Vec<ModuleHandle>
Handles to all modules referenced.
struct_handles: Vec<StructHandle>
Handles to external/imported types.
function_handles: Vec<FunctionHandle>
Handles to external/imported functions.
function_instantiations: Vec<FunctionInstantiation>
Function instantiations.
signatures: SignaturePool
§identifiers: IdentifierPool
All identifiers used in this transaction.
address_identifiers: AddressIdentifierPool
All address identifiers used in this transaction.
constant_pool: ConstantPool
Constant pool. The constant values used in the transaction.
type_parameters: Vec<AbilitySet>
§parameters: SignatureIndex
§code: CodeUnit
Implementations§
source§impl CompiledScript
impl CompiledScript
sourcepub fn deserialize(binary: &[u8]) -> BinaryLoaderResult<Self>
pub fn deserialize(binary: &[u8]) -> BinaryLoaderResult<Self>
Deserializes a &u8 slice into a CompiledScript
instance.
source§impl CompiledScript
impl CompiledScript
sourcepub const MAIN_INDEX: FunctionDefinitionIndex = _
pub const MAIN_INDEX: FunctionDefinitionIndex = _
Returns the index of main
in case a script is converted to a module.
Trait Implementations§
source§impl Arbitrary for CompiledScript
impl Arbitrary for CompiledScript
§type Parameters = usize
type Parameters = usize
The size of the compiled script.
§type Strategy = BoxedStrategy<CompiledScript>
type Strategy = BoxedStrategy<CompiledScript>
Strategy
used to generate values of type Self
.source§fn arbitrary_with(size: Self::Parameters) -> Self::Strategy
fn arbitrary_with(size: Self::Parameters) -> Self::Strategy
source§impl Clone for CompiledScript
impl Clone for CompiledScript
source§fn clone(&self) -> CompiledScript
fn clone(&self) -> CompiledScript
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CompiledScript
impl Debug for CompiledScript
source§impl Default for CompiledScript
impl Default for CompiledScript
source§fn default() -> CompiledScript
fn default() -> CompiledScript
source§impl PartialEq<CompiledScript> for CompiledScript
impl PartialEq<CompiledScript> for CompiledScript
source§fn eq(&self, other: &CompiledScript) -> bool
fn eq(&self, other: &CompiledScript) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl ScriptAccess for CompiledScript
impl ScriptAccess for CompiledScript
source§fn as_script(&self) -> &CompiledScript
fn as_script(&self) -> &CompiledScript
CompiledScript
that will be used for accesses.