Module wasmtime_wasi::preview2
source · Expand description
Wasmtime’s WASI Preview 2 Implementation
Welcome to the (new!) WASI implementation from the Wasmtime team. The goal of this implementation is to support WASI Preview 2 via the Component Model, as well as to provide legacy Preview 1 host support with an adapter that is implemented in terms of the Preview 2 interfaces.
Presently, this crate is experimental. We don’t yet recommend you use it in production. Specifically:
- the wit files in tree describing preview 2 are not faithful to the standards repos
Once these issues are resolved, we expect to move this namespace up to the
root of the wasmtime-wasi crate, and move its other exports underneath a
pub mod legacy
with an off-by-default feature flag, and after 2
releases, retire and remove that code from our tree.
Modules
- Virtual pipes.
Structs
- Implement
insecure-random
using a deterministic cycle of bytes. - An error returned from the
proc_exit
host syscall. - A host representation of the
wasi:io/poll.pollable
resource. - Only public interface is the
HostInputStream
impl. - The
Table
type is designed to map u32 handles to resources. The table is now part of the public interface to aWasiCtx
- it is reference counted so that it can be shared beyond aWasiCtx
with other WASI proposals (e.g.wasi-crypto
andwasi-nn
) to manage their resources. Elements in theTable
areAny
typed. - A helper error type used by many other modules through type aliases.
Enums
- A value for specifying a time.
Traits
- Host trait for implementing the
wasi:io/streams.input-stream
resource: A bytestream which can be read from. - Host trait for implementing the
wasi:io/streams.output-stream
resource: A bytestream which can be written to. - The core of a random number generator.
- A trait used to represent the standard input to a guest program.
- Similar to
StdinStream
, except for output.
Functions
- Creates a
pollable
resource which is susbcribed to the providedresource
.