pub struct HostState {
pub bridge: Arc<dyn Bridge>,
pub observations: Arc<Mutex<Vec<Observation>>>,
pub context_id: ContextId,
pub config: SandboxConfig,
}Expand description
Host state accessible from WASM imported functions.
The bridge and observations fields are accessed via Arc clones
captured by the linker closures, not through the struct directly.
The struct owns them to keep them alive for the store’s lifetime.
Fields§
§bridge: Arc<dyn Bridge>§observations: Arc<Mutex<Vec<Observation>>>§context_id: ContextId§config: SandboxConfigAuto Trait Implementations§
impl Freeze for HostState
impl !RefUnwindSafe for HostState
impl Send for HostState
impl Sync for HostState
impl Unpin for HostState
impl UnsafeUnpin for HostState
impl !UnwindSafe for HostState
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