[−][src]Struct wasmer_runtime::Instance
An instantiated WebAssembly module.
An Instance
represents a WebAssembly module that
has been instantiated with an ImportObject
and is
ready to be called.
Methods
impl Instance
[src]
pub fn func(&mut self, name: &str) -> Result<Function, Box<ResolveError>>
[src]
This returns the representation of a function that can be called safely.
Usage:
instance .func("foo")? .call(&[])?;
pub fn call(
&mut self,
name: &str,
args: &[Value]
) -> Result<Vec<Value>, Box<CallError>>
[src]
&mut self,
name: &str,
args: &[Value]
) -> Result<Vec<Value>, Box<CallError>>
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
.
Note:
This returns CallResult<Vec<Value>>
in order to support
the future multi-value returns webassembly feature.
Usage:
// ... 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.
pub fn exports(&mut self) -> ExportIter
[src]
Returns a iterator over all of the items exported from this instance.
pub fn module(&self) -> Module
[src]
The module used to instantiate this Instance.
Trait Implementations
impl LikeNamespace for Instance
[src]
fn get_export(&mut self, name: &str) -> Option<Export>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,