Struct wasmtime_environ::ModuleEnvironment
source · [−]pub struct ModuleEnvironment<'data> { /* private fields */ }
Expand description
Object containing the standalone environment information.
Implementations
sourceimpl<'data> ModuleEnvironment<'data>
impl<'data> ModuleEnvironment<'data>
sourcepub fn new(tunables: &Tunables, features: &WasmFeatures) -> Self
pub fn new(tunables: &Tunables, features: &WasmFeatures) -> Self
Allocates the environment data structures.
sourcepub 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.
Auto Trait Implementations
impl<'data> RefUnwindSafe for ModuleEnvironment<'data>
impl<'data> Send for ModuleEnvironment<'data>
impl<'data> Sync for ModuleEnvironment<'data>
impl<'data> Unpin for ModuleEnvironment<'data>
impl<'data> UnwindSafe for ModuleEnvironment<'data>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more