pub struct StoreData {
pub engine_access: *const dyn EngineAccess,
pub now: f64,
pub injected_actions: Vec<ActionWire>,
pub injected_action_bytes: usize,
pub program_name: String,
pub log_messages_forwarded: usize,
pub log_messages_dropped: usize,
pub provider_events: Vec<RawProviderEvent>,
pub provider_event_bytes: usize,
pub provider_events_enabled: bool,
pub limits: StoreLimits,
}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>§injected_action_bytes: usizeTotal payload bytes of injected_actions in the current call.
program_name: StringName of the program owning this store, used to tag forwarded log lines.
log_messages_forwarded: usizeLog messages forwarded to the host logger in the current call.
log_messages_dropped: usizeLog messages dropped in the current call because the per-call cap was reached.
provider_events: Vec<RawProviderEvent>§provider_event_bytes: usizeTotal bytes (type + payload) of provider_events in the current call.
provider_events_enabled: bool§limits: StoreLimitsResource limits (memory size, instance/table/memory counts) for the store.
Implementations§
Source§impl StoreData
impl StoreData
Sourcepub fn new(
program_name: String,
engine_access: *const dyn EngineAccess,
now: f64,
provider_events_enabled: bool,
max_memory: usize,
) -> Self
pub fn new( program_name: String, engine_access: *const dyn EngineAccess, now: f64, provider_events_enabled: bool, max_memory: usize, ) -> Self
Create store data for one program with resource limits capping linear
memory at max_memory bytes.
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§
impl Send for StoreData
wasm only.impl Sync for StoreData
wasm only.Auto Trait Implementations§
impl !RefUnwindSafe for StoreData
impl !UnwindSafe for StoreData
impl Freeze for StoreData
impl Unpin for StoreData
impl UnsafeUnpin 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
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