Trait wasmer_engine::Artifact [−][src]
pub trait Artifact: Send + Sync + Upcastable + MemoryUsage {}Show methods
fn module(&self) -> Arc<ModuleInfo>; fn module_ref(&self) -> &ModuleInfo; fn module_mut(&mut self) -> Option<&mut ModuleInfo>; fn register_frame_info(&self); fn features(&self) -> &Features; fn memory_styles(&self) -> &PrimaryMap<MemoryIndex, MemoryStyle>; fn table_styles(&self) -> &PrimaryMap<TableIndex, TableStyle>; fn data_initializers(&self) -> &[OwnedDataInitializer]; 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; fn serialize(&self) -> Result<Vec<u8>, SerializeError>; fn serialize_to_file(&self, path: &Path) -> Result<(), SerializeError> { ... } 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,
handle: &InstanceHandle
) -> Result<(), InstantiationError> { ... }
Expand description
An Artifact
is the product that the Engine
implementation produce and use.
The Artifact
contains the compiled data for a given
module as well as extra information needed to run the
module at runtime, such as ModuleInfo
and Features
.
Required methods
fn module(&self) -> Arc<ModuleInfo>
[src]
fn module(&self) -> Arc<ModuleInfo>
[src]Return a reference-counted pointer to the module
fn module_ref(&self) -> &ModuleInfo
[src]
fn module_ref(&self) -> &ModuleInfo
[src]Return a pointer to a module.
fn module_mut(&mut self) -> Option<&mut ModuleInfo>
[src]
fn module_mut(&mut self) -> Option<&mut ModuleInfo>
[src]Gets a mutable reference to the info.
Note: this will return None
if the module is already instantiated.
fn register_frame_info(&self)
[src]
fn register_frame_info(&self)
[src]Register thie Artifact
stack frame information into the global scope.
This is required to ensure that any traps can be properly symbolicated.
fn memory_styles(&self) -> &PrimaryMap<MemoryIndex, MemoryStyle>
[src]
fn memory_styles(&self) -> &PrimaryMap<MemoryIndex, MemoryStyle>
[src]Returns the memory styles associated with this Artifact
.
fn table_styles(&self) -> &PrimaryMap<TableIndex, TableStyle>
[src]
fn table_styles(&self) -> &PrimaryMap<TableIndex, TableStyle>
[src]Returns the table plans associated with this Artifact
.
fn data_initializers(&self) -> &[OwnedDataInitializer]
[src]
fn data_initializers(&self) -> &[OwnedDataInitializer]
[src]Returns data initializers to pass to InstanceHandle::initialize
fn finished_functions(&self) -> &BoxedSlice<LocalFunctionIndex, FunctionBodyPtr>
[src]
fn finished_functions(&self) -> &BoxedSlice<LocalFunctionIndex, FunctionBodyPtr>
[src]Returns the functions allocated in memory or this Artifact
ready to be run.
fn finished_function_call_trampolines(
&self
) -> &BoxedSlice<SignatureIndex, VMTrampoline>
[src]
fn finished_function_call_trampolines(
&self
) -> &BoxedSlice<SignatureIndex, VMTrampoline>
[src]Returns the function call trampolines allocated in memory of this
Artifact
, ready to be run.
fn finished_dynamic_function_trampolines(
&self
) -> &BoxedSlice<FunctionIndex, FunctionBodyPtr>
[src]
fn finished_dynamic_function_trampolines(
&self
) -> &BoxedSlice<FunctionIndex, FunctionBodyPtr>
[src]Returns the dynamic function trampolines allocated in memory
of this Artifact
, ready to be run.
fn signatures(&self) -> &BoxedSlice<SignatureIndex, VMSharedSignatureIndex>
[src]
fn signatures(&self) -> &BoxedSlice<SignatureIndex, VMSharedSignatureIndex>
[src]Returns the associated VM signatures for this Artifact
.
fn func_data_registry(&self) -> &FuncDataRegistry
[src]
fn func_data_registry(&self) -> &FuncDataRegistry
[src]Get the func data registry
Provided methods
fn serialize_to_file(&self, path: &Path) -> Result<(), SerializeError>
[src]
fn serialize_to_file(&self, path: &Path) -> Result<(), SerializeError>
[src]Serializes an artifact into a file path
fn preinstantiate(&self) -> Result<(), InstantiationError>
[src]
fn preinstantiate(&self) -> Result<(), InstantiationError>
[src]Do preinstantiation logic that is executed before instantiating
unsafe fn instantiate(
&self,
tunables: &dyn Tunables,
resolver: &dyn Resolver,
host_state: Box<dyn Any>
) -> Result<InstanceHandle, InstantiationError>
[src]
unsafe fn instantiate(
&self,
tunables: &dyn Tunables,
resolver: &dyn Resolver,
host_state: Box<dyn Any>
) -> Result<InstanceHandle, InstantiationError>
[src]unsafe fn finish_instantiation(
&self,
trap_handler: &dyn TrapHandler,
handle: &InstanceHandle
) -> Result<(), InstantiationError>
[src]
unsafe fn finish_instantiation(
&self,
trap_handler: &dyn TrapHandler,
handle: &InstanceHandle
) -> Result<(), InstantiationError>
[src]Finishes the instantiation of a just created InstanceHandle
.
Safety
Implementations
Try to downcast the artifact into a given type.
Try to downcast the artifact into a given type mutably.