Trait wasmtime::AsContextMut[][src]

pub trait AsContextMut: AsContext {
    fn as_context_mut(&mut self) -> StoreContextMut<'_, Self::Data>;
}
Expand description

A trait used to get exclusive mutable access to a Store in Wasmtime.

This trait is used as a bound on the first argument of many methods within Wasmtime. This trait is implemented for types like Store, Caller, and StoreContextMut itself. Implementors of this trait provide access to a StoreContextMut via some means, allowing the method in question to get access to the store’s internal information.

This is notably used for methods that may require some mutation of the Store itself. For example calling a wasm function can mutate linear memory or globals. Creation of a Func will update internal data structures. This ends up being quite a common bound in Wasmtime, but typically you can simply pass &mut store or &mut caller to satisfy it.

Required methods

Returns the store context that this type provides access to.

Implementations on Foreign Types

Implementors