pub struct HostState {
pub limits: Limits,
pub log_lines: Vec<(LogLevel, String)>,
pub store_limits: StoreLimits,
pub resource_table: ResourceTable,
pub wasi: WasiCtx,
}Expand description
Per-invocation state held in wasmtime::Store<HostState>.
The wasi field is a deny-all WasiCtx: no preopens, no environment,
no inherited stdio. We wire wasmtime_wasi into the linker only because
the wasm32-wasip2 rust libstd unconditionally imports WASI interfaces
(clocks, filesystem, stdio, exit, …). With a deny-all context, calls
fail at runtime — same outcome as a trap, but using the well-tested
wasmtime-wasi resource handling instead of hand-rolled stubs.
Fields§
§limits: Limits§log_lines: Vec<(LogLevel, String)>§store_limits: StoreLimits§resource_table: ResourceTable§wasi: WasiCtxTrait Implementations§
Source§impl Host for HostState
impl Host for HostState
Source§impl Host for HostState
impl Host for HostState
Source§impl WasiView for HostState
impl WasiView for HostState
Source§fn ctx(&mut self) -> WasiCtxView<'_>
fn ctx(&mut self) -> WasiCtxView<'_>
Yields mutable access to the
WasiCtx configuration used for this
context.impl Host for HostState
impl Host for HostState
impl Host for HostState
impl Host for HostState
Auto 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> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
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