pub struct Instance { /* fields omitted */ }
An instantiated WebAssembly module.
An Instance
represents a WebAssembly module that
has been instantiated with an ImportObject
and is
ready to be called.
This returns the representation of a function that can be called
safely.
instance
.func("foo")?
.call(&[])?;
Call an exported webassembly function given the export name.
Pass arguments by wrapping each one in the Value
enum.
The returned values are also each wrapped in a Value
.
This returns CallResult<Vec<Value>>
in order to support
the future multi-value returns webassembly feature.
let results = instance.call("foo", &[Value::I32(42)])?;
pub fn context(&self) -> &Ctx | [src] |
Returns a immutable reference to the
Ctx
used by this Instance.
pub fn context_mut(&mut self) -> &mut Ctx | [src] |
Returns a mutable reference to the
Ctx
used by this Instance.
Returns a iterator over all of the items
exported from this instance.
The module used to instantiate this Instance.
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static