Struct wasmtime_environ::ModuleEnvironment[][src]

pub struct ModuleEnvironment<'data> { /* fields omitted */ }

Object containing the standalone environment information.

Implementations

impl<'data> ModuleEnvironment<'data>[src]

pub fn new(
    target_config: TargetFrontendConfig,
    tunables: &Tunables,
    features: &WasmFeatures
) -> Self
[src]

Allocates the environment data structures.

pub fn translate(
    self,
    data: &'data [u8]
) -> WasmResult<(usize, Vec<ModuleTranslation<'data>>, TypeTables)>
[src]

Translate a wasm module using this environment.

This consumes the ModuleEnvironment and produces a list of ModuleTranslations 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.

Trait Implementations

impl<'data> ModuleEnvironment<'data> for ModuleEnvironment<'data>[src]

This trait is useful for translate_module because it tells how to translate environment-dependent wasm instructions. These functions should not be called by the user.

impl<'data> TargetEnvironment for ModuleEnvironment<'data>[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.