pub struct WasmtimeInstance { /* private fields */ }Expand description
A wrapper around a Wasmtime instance.
The Wasmtime engine constructs a new store and compiles an instance of a Wasm module.
Implementations§
Source§impl WasmtimeInstance
impl WasmtimeInstance
Sourcepub fn new(store: Store<StoreLimits>, module: Module) -> Result<Self>
pub fn new(store: Store<StoreLimits>, module: Module) -> Result<Self>
Instantiate a new Wasmtime instance.
Sourcepub fn exported_functions(&mut self) -> Vec<(String, FuncType)>
pub fn exported_functions(&mut self) -> Vec<(String, FuncType)>
Retrieve the names and types of all exported functions in the instance.
This is useful for evaluating each exported function with different
values. The DiffInstance trait asks for the function name and we
need to know the function signature in order to pass in the right
arguments.
Sourcepub fn exported_globals(&mut self) -> Vec<(String, DiffValueType)>
pub fn exported_globals(&mut self) -> Vec<(String, DiffValueType)>
Returns the list of globals and their types exported from this instance.
Sourcepub fn exported_memories(&mut self) -> Vec<(String, bool)>
pub fn exported_memories(&mut self) -> Vec<(String, bool)>
Returns the list of exported memories and whether or not it’s a shared memory.
Trait Implementations§
Source§impl DiffInstance for WasmtimeInstance
impl DiffInstance for WasmtimeInstance
Source§fn evaluate(
&mut self,
function_name: &str,
arguments: &[DiffValue],
_results: &[DiffValueType],
) -> Result<Option<Vec<DiffValue>>>
fn evaluate( &mut self, function_name: &str, arguments: &[DiffValue], _results: &[DiffValueType], ) -> Result<Option<Vec<DiffValue>>>
Evaluate an exported function with the given values. Read more
Source§fn get_global(&mut self, name: &str, _ty: DiffValueType) -> Option<DiffValue>
fn get_global(&mut self, name: &str, _ty: DiffValueType) -> Option<DiffValue>
Attempts to return the value of the specified global, returning
None
if this engine doesn’t support retrieving globals at this time.Auto Trait Implementations§
impl !RefUnwindSafe for WasmtimeInstance
impl !UnwindSafe for WasmtimeInstance
impl Freeze for WasmtimeInstance
impl Send for WasmtimeInstance
impl Sync for WasmtimeInstance
impl Unpin for WasmtimeInstance
impl UnsafeUnpin for WasmtimeInstance
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more