Trait wasm_runtime_layer::AsContext

source ·
pub trait AsContext {
    type Engine: WasmEngine;
    type UserState;

    // Required method
    fn as_context(&self) -> StoreContext<'_, Self::UserState, Self::Engine>;
}
Expand description

A trait used to get shared access to a Store.

Required Associated Types§

source

type Engine: WasmEngine

The engine type associated with the context.

source

type UserState

The user state associated with the Store, aka the T in Store<T>.

Required Methods§

source

fn as_context(&self) -> StoreContext<'_, Self::UserState, Self::Engine>

Returns the store context that this type provides access to.

Implementations on Foreign Types§

source§

impl<T: AsContext> AsContext for &T

§

type Engine = <T as AsContext>::Engine

§

type UserState = <T as AsContext>::UserState

source§

fn as_context(&self) -> StoreContext<'_, Self::UserState, Self::Engine>

source§

impl<T: AsContext> AsContext for &mut T

§

type Engine = <T as AsContext>::Engine

§

type UserState = <T as AsContext>::UserState

source§

fn as_context(&self) -> StoreContext<'_, Self::UserState, Self::Engine>

Implementors§

source§

impl<'a, T: 'a, E: WasmEngine> AsContext for StoreContext<'a, T, E>

§

type Engine = E

§

type UserState = T

source§

impl<'a, T: 'a, E: WasmEngine> AsContext for StoreContextMut<'a, T, E>

§

type Engine = E

§

type UserState = T

source§

impl<T, E: WasmEngine> AsContext for Store<T, E>

§

type Engine = E

§

type UserState = T