Struct wasmtime_environ::ModuleEnvironment [−][src]
pub struct ModuleEnvironment<'data> { /* fields omitted */ }
Expand description
Object containing the standalone environment information.
Implementations
Allocates the environment data structures.
pub fn translate(
self,
data: &'data [u8]
) -> WasmResult<(usize, Vec<ModuleTranslation<'data>>, TypeTables)>
pub fn translate(
self,
data: &'data [u8]
) -> WasmResult<(usize, Vec<ModuleTranslation<'data>>, TypeTables)>
Translate a wasm module using this environment.
This consumes the ModuleEnvironment
and produces a list of
ModuleTranslation
s as well as a TypeTables
. The list of module
translations corresponds to all wasm modules found in the input data
.
Note that for MVP modules this will always be a list with one element,
but with the module linking proposal this may have many elements.
For the module linking proposal the top-level module is returned as the first return value.
The TypeTables
structure returned contains intern’d versions of types
referenced from each module translation. This primarily serves as the
source of truth for module-linking use cases where modules can refer to
other module’s types. All SignatureIndex
, ModuleTypeIndex
, and
InstanceTypeIndex
values are resolved through the returned tables.