Trait wasm_runtime_layer::backend::WasmStore

source ·
pub trait WasmStore<T, E: WasmEngine>: AsContext<E, UserState = T> + AsContextMut<E, UserState = T> {
    // Required methods
    fn new(engine: &E, data: T) -> Self;
    fn engine(&self) -> &E;
    fn data(&self) -> &T;
    fn data_mut(&mut self) -> &mut T;
    fn into_data(self) -> T;
}
Expand description

Provides all of the global state that can be manipulated by WASM programs.

Required Methods§

source

fn new(engine: &E, data: T) -> Self

Creates a new store atop the given engine.

source

fn engine(&self) -> &E

Gets the engine associated with this store.

source

fn data(&self) -> &T

Gets an immutable reference to the underlying stored data.

source

fn data_mut(&mut self) -> &mut T

Gets a mutable reference to the underlying stored data.

source

fn into_data(self) -> T

Consumes self and returns its user provided data.

Object Safety§

This trait is not object safe.

Implementors§