pub struct StoreHookState<'a, T>where
T: 'static,{ /* private fields */ }Expand description
State yielded to and epoch deadline callback or a call hook.
This structure is similar to StoreContextMut except that it does not
implement AsContextMut and instead only implements AsContext. This
means that the store can be inspected and read but not mutated. This
structure does allow mutable access to the underlying T within the
store, however.
This type is used in APIs such as Store::epoch_deadline_callback and
Store::call_hook where the embedder is given access to the store at
points in time where it’s not valid to mutate WebAssembly-facing state.
For example when an epoch deadline happens WebAssembly is between two
instructions and general state in the module cannot be mutated spec-wise.
This type expresses this static guarantee by ensuring that store data
can be read, embedder-specific data can be mutated, but nothing within the
store otherwise can be mutated.
Implementations§
Trait Implementations§
Source§impl<'a, T> AsContext for StoreHookState<'a, T>
impl<'a, T> AsContext for StoreHookState<'a, T>
Source§fn as_context(&self) -> StoreContext<'_, T>
fn as_context(&self) -> StoreContext<'_, T>
Auto Trait Implementations§
impl<'a, T> !RefUnwindSafe for StoreHookState<'a, T>
impl<'a, T> !UnwindSafe for StoreHookState<'a, T>
impl<'a, T> Freeze for StoreHookState<'a, T>where
StoreContextMut<'a, T>: Freeze,
impl<'a, T> Send for StoreHookState<'a, T>where
StoreContextMut<'a, T>: Send,
impl<'a, T> Sync for StoreHookState<'a, T>where
StoreContextMut<'a, T>: Sync,
impl<'a, T> Unpin for StoreHookState<'a, T>where
StoreContextMut<'a, T>: Unpin,
impl<'a, T> UnsafeUnpin for StoreHookState<'a, T>where
StoreContextMut<'a, T>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more