pub struct StoreData {
pub engine_access: *const dyn EngineAccess,
pub now: f64,
pub injected_actions: Vec<ActionWire>,
pub log_messages: Vec<String>,
pub provider_events: Vec<RawProviderEvent>,
pub provider_events_enabled: bool,
}Expand description
Data stored in each wasmtime Store.
Uses a raw pointer for EngineAccess because Linker<T> requires T
without lifetime parameters. The Store is cached across calls for instance
persistence, but engine_access is refreshed each call via reset_per_call
and must only be dereferenced during the active call.
Fields§
§engine_access: *const dyn EngineAccess§now: f64§injected_actions: Vec<ActionWire>§log_messages: Vec<String>§provider_events: Vec<RawProviderEvent>§provider_events_enabled: boolImplementations§
Source§impl StoreData
impl StoreData
Sourcepub unsafe fn engine(&self) -> &dyn EngineAccess
pub unsafe fn engine(&self) -> &dyn EngineAccess
Access the engine through the raw pointer.
§Safety
The caller must ensure the pointer is still valid.
Sourcepub fn reset_per_call(
&mut self,
engine_access: *const dyn EngineAccess,
now: f64,
provider_events_enabled: bool,
)
pub fn reset_per_call( &mut self, engine_access: *const dyn EngineAccess, now: f64, provider_events_enabled: bool, )
Reset per-call fields while preserving the store (and WASM linear memory).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StoreData
impl !RefUnwindSafe for StoreData
impl Unpin for StoreData
impl UnsafeUnpin for StoreData
impl !UnwindSafe for StoreData
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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