pub trait Artifact:
Send
+ Sync
+ Upcastable
+ MemoryUsage
+ ArtifactCreate {
// Required methods
fn register_frame_info(&self);
fn finished_functions(
&self,
) -> &BoxedSlice<LocalFunctionIndex, FunctionBodyPtr>;
fn finished_function_call_trampolines(
&self,
) -> &BoxedSlice<SignatureIndex, VMTrampoline>;
fn finished_dynamic_function_trampolines(
&self,
) -> &BoxedSlice<FunctionIndex, FunctionBodyPtr>;
fn signatures(&self) -> &BoxedSlice<SignatureIndex, VMSharedSignatureIndex>;
fn func_data_registry(&self) -> &FuncDataRegistry;
// Provided methods
fn preinstantiate(&self) -> Result<(), InstantiationError> { ... }
unsafe fn instantiate(
&self,
tunables: &dyn Tunables,
resolver: &dyn Resolver,
host_state: Box<dyn Any>,
) -> Result<InstanceHandle, InstantiationError> { ... }
unsafe fn finish_instantiation(
&self,
trap_handler: &(dyn TrapHandler + 'static),
handle: &InstanceHandle,
) -> Result<(), InstantiationError> { ... }
}
Expand description
An Artifact
is the product that the Engine
implementation produce and use.
An Artifact
is the product that the Engine
implementation produce and use.
The ArtifactRun
contains the extra information needed to run the
module at runtime, such as [ModuleInfo
] and [Features
].
Required Methods§
Sourcefn register_frame_info(&self)
fn register_frame_info(&self)
Register thie Artifact
stack frame information into the global scope.
This is required to ensure that any traps can be properly symbolicated.
Sourcefn finished_functions(&self) -> &BoxedSlice<LocalFunctionIndex, FunctionBodyPtr>
fn finished_functions(&self) -> &BoxedSlice<LocalFunctionIndex, FunctionBodyPtr>
Returns the functions allocated in memory or this Artifact
ready to be run.
Sourcefn finished_function_call_trampolines(
&self,
) -> &BoxedSlice<SignatureIndex, VMTrampoline>
fn finished_function_call_trampolines( &self, ) -> &BoxedSlice<SignatureIndex, VMTrampoline>
Returns the function call trampolines allocated in memory of this
Artifact
, ready to be run.
Sourcefn finished_dynamic_function_trampolines(
&self,
) -> &BoxedSlice<FunctionIndex, FunctionBodyPtr>
fn finished_dynamic_function_trampolines( &self, ) -> &BoxedSlice<FunctionIndex, FunctionBodyPtr>
Returns the dynamic function trampolines allocated in memory
of this Artifact
, ready to be run.
Sourcefn signatures(&self) -> &BoxedSlice<SignatureIndex, VMSharedSignatureIndex>
fn signatures(&self) -> &BoxedSlice<SignatureIndex, VMSharedSignatureIndex>
Returns the associated VM signatures for this Artifact
.
Sourcefn func_data_registry(&self) -> &FuncDataRegistry
fn func_data_registry(&self) -> &FuncDataRegistry
Get the func data registry
Provided Methods§
Sourcefn preinstantiate(&self) -> Result<(), InstantiationError>
fn preinstantiate(&self) -> Result<(), InstantiationError>
Do preinstantiation logic that is executed before instantiating
Sourceunsafe fn instantiate(
&self,
tunables: &dyn Tunables,
resolver: &dyn Resolver,
host_state: Box<dyn Any>,
) -> Result<InstanceHandle, InstantiationError>
unsafe fn instantiate( &self, tunables: &dyn Tunables, resolver: &dyn Resolver, host_state: Box<dyn Any>, ) -> Result<InstanceHandle, InstantiationError>
Sourceunsafe fn finish_instantiation(
&self,
trap_handler: &(dyn TrapHandler + 'static),
handle: &InstanceHandle,
) -> Result<(), InstantiationError>
unsafe fn finish_instantiation( &self, trap_handler: &(dyn TrapHandler + 'static), handle: &InstanceHandle, ) -> Result<(), InstantiationError>
Finishes the instantiation of a just created InstanceHandle
.