Trait AsContext

Source
pub trait AsContext {
    type Engine: WasmEngine;
    type UserState: 'static;

    // 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: 'static

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

Source§

impl<T: AsContext> AsContext for &mut T

Implementors§

Source§

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

Source§

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

Source§

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