Struct wasmtime_runtime::InstanceAllocationRequest [−][src]
pub struct InstanceAllocationRequest<'a> { pub module: Arc<Module>, pub finished_functions: &'a PrimaryMap<DefinedFuncIndex, *mut [VMFunctionBody]>, pub imports: Imports<'a>, pub shared_signatures: SharedSignatures<'a>, pub host_state: Box<dyn Any + Send + Sync>, pub store: Option<*mut dyn Store>, }
Expand description
Represents a request for a new runtime instance.
Fields
module: Arc<Module>
The module being instantiated.
finished_functions: &'a PrimaryMap<DefinedFuncIndex, *mut [VMFunctionBody]>
The finished (JIT) functions for the module.
imports: Imports<'a>
The imports to use for the instantiation.
Translation from SignatureIndex
to VMSharedSignatureIndex
host_state: Box<dyn Any + Send + Sync>
The host state to associate with the instance.
store: Option<*mut dyn Store>
A pointer to the “store” for this instance to be allocated. The store
correlates with the Store
in wasmtime itself, and lots of contextual
information about the execution of wasm can be learned through the store.
Note that this is a raw pointer and has a static lifetime, both of which are a bit of a lie. This is done purely so a store can learn about itself when it gets called as a host function, and additionally so this runtime can access internals as necessary (such as the VMExternRefActivationsTable or the ResourceLimiter).
Note that this ends up being a self-pointer to the instance when stored.
The reason is that the instance itself is then stored within the store.
We use a number of PhantomPinned
declarations to indicate this to the
compiler. More info on this in wasmtime/src/store.rs
Auto Trait Implementations
impl<'a> !RefUnwindSafe for InstanceAllocationRequest<'a>
impl<'a> !Send for InstanceAllocationRequest<'a>
impl<'a> !Sync for InstanceAllocationRequest<'a>
impl<'a> Unpin for InstanceAllocationRequest<'a>
impl<'a> !UnwindSafe for InstanceAllocationRequest<'a>