pub trait WasiNamedView: Send + 'static {
// Required method
fn ctx(&mut self, id: NamedId) -> WasiCtxView<'_>;
}Expand description
A trait which provides access to a specific WasiCtx as scoped by a
NamedId parameter.
This trait is used as part of convenience
wasmtime_wasi::p3::add_named_to_linker functions for example. This is
used to scope access of a WASI context within a specific id or named
import.
Required Methods§
Sourcefn ctx(&mut self, id: NamedId) -> WasiCtxView<'_>
fn ctx(&mut self, id: NamedId) -> WasiCtxView<'_>
Yields mutable access to the WasiCtx configuration used for this
context.
It’s strongly recommended, though not always required, that the
ResourceTable in the returned WasiCtxView is the same table that
WasiView::ctx returns. Resources created through a named import can
be used through interfaces bound to the default context (and vice
versa), for example streams returned by a named wasi:cli/stdout are
used through wasi:io/streams, and with separate tables those lookups
fail or find another context’s resources.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".