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.

shared_signatures: SharedSignatures<'a>

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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.