Struct wasm_runtime_layer::StoreContextMut

source ·
pub struct StoreContextMut<'a, T: 'a, E: WasmEngine> {
    pub inner: E::StoreContextMut<'a, T>,
}
Expand description

A temporary handle to a &mut Store<T>.

This type is suitable for AsContextMut or AsContext trait bounds on methods if desired. For more information, see Store.

Fields§

§inner: E::StoreContextMut<'a, T>

The backing implementation.

Implementations§

source§

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

source

pub fn engine(&self) -> &Engine<E>

Returns the underlying Engine this store is connected to.

source

pub fn data(&self) -> &T

Access the underlying data owned by this store.

Same as Store::data.

source

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

Access the underlying data owned by this store.

Same as Store::data_mut.

Trait Implementations§

source§

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

§

type Engine = E

The engine type associated with the context.
§

type UserState = T

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

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

Returns the store context that this type provides access to.
source§

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

source§

fn as_context_mut( &mut self ) -> StoreContextMut<'_, Self::UserState, Self::Engine>

Returns the store context that this type provides access to.

Auto Trait Implementations§

§

impl<'a, T, E> Freeze for StoreContextMut<'a, T, E>
where <E as WasmEngine>::StoreContextMut<'a, T>: Freeze,

§

impl<'a, T, E> RefUnwindSafe for StoreContextMut<'a, T, E>

§

impl<'a, T, E> Send for StoreContextMut<'a, T, E>
where <E as WasmEngine>::StoreContextMut<'a, T>: Send,

§

impl<'a, T, E> Sync for StoreContextMut<'a, T, E>
where <E as WasmEngine>::StoreContextMut<'a, T>: Sync,

§

impl<'a, T, E> Unpin for StoreContextMut<'a, T, E>
where <E as WasmEngine>::StoreContextMut<'a, T>: Unpin,

§

impl<'a, T, E> UnwindSafe for StoreContextMut<'a, T, E>
where <E as WasmEngine>::StoreContextMut<'a, T>: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<E, C> AsContext<E> for C
where C: AsContext<Engine = E>, E: WasmEngine,

§

type UserState = <C as AsContext>::UserState

The type of data associated with the store.
source§

fn as_context( &self ) -> <E as WasmEngine>::StoreContext<'_, <C as AsContext<E>>::UserState>

Returns the store context that this type provides access to.
source§

impl<E, C> AsContextMut<E> for C
where C: AsContextMut<Engine = E>, E: WasmEngine,

source§

fn as_context_mut( &mut self ) -> <E as WasmEngine>::StoreContextMut<'_, <C as AsContext<E>>::UserState>

Returns the store context that this type provides access to.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.