[][src]Struct wasmtime_interface_types::ModuleData

pub struct ModuleData { /* fields omitted */ }

A data structure intended to hold a parsed representation of the wasm interface types of a module.

The expected usage pattern is to create this next to wasmtime data structures and then use this to process arguments into wasm arguments as appropriate for bound functions.

Methods

impl ModuleData[src]

pub fn new(wasm: &[u8]) -> Result<ModuleData>[src]

Parses a raw binary wasm file, extracting information about wasm interface types.

Returns an error if the wasm file is malformed.

pub fn find_wasi_module_name(&self) -> Option<String>[src]

Detects if WASI support is needed: returns module name that is requested.

pub fn invoke_export(
    &self,
    instance: &Instance,
    export: &str,
    args: &[Value]
) -> Result<Vec<Value>>
[src]

Invokes wasmtime function with a &[Value] list. Value the set of wasm interface types.

pub fn binding_for_export(
    &self,
    instance: &mut InstanceHandle,
    name: &str
) -> Result<ExportBinding>
[src]

Returns an appropriate binding for the name export in this module which has also been instantiated as instance provided here.

Returns an error if name is not present in the module.

Auto Trait Implementations

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> Same<T> for T

type Output = T

Should always be Self

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.