Crate wasmtime_wasi

Source
Expand description

§Wasmtime’s WASI Implementation

This crate provides a Wasmtime host implementations of different versions of WASI. WASI is implemented with the Rust crates [tokio] and cap-std primarily, meaning that operations are implemented in terms of their native platform equivalents by default.

For components and WASIp2, see p2. For WASIp1 and core modules, see the [preview1] module documentation.

For WASIp3, see [p3]. WASIp3 support is experimental, unstable and incomplete.

Re-exports§

pub use self::clocks::HostMonotonicClock;
pub use self::clocks::HostWallClock;
pub use self::random::Deterministic;
pub use self::random::thread_rng;
pub use async_trait::async_trait;
pub use cap_fs_ext::SystemTimeSpec;
pub use cap_rand::RngCore;
pub use wasmtime::component::ResourceTable;
pub use wasmtime::component::ResourceTableError;

Modules§

cli
clocks
p0p1
Bindings for WASIp0 aka Preview 0 aka wasi_unstable.
p1p1
Bindings for WASIp1 aka Preview 1 aka wasi_snapshot_preview1.
p2
Wasmtime’s WASIp2 Implementation
random
runtime
This module provides an “ambient Tokio runtime” with_ambient_tokio_runtime. Embedders of wasmtime-wasi may do so from synchronous Rust, and not use tokio directly. The implementation of wasmtime-wasi requires a tokio executor in a way that is deeply tied to its design. When used from a synchronous wasmtime context, this module provides the wrapper function in_tokio used throughout the shim implementations of synchronous component binding Host traits in terms of the async ones.
sockets

Structs§

DirPerms
Permission bits for operating on a directory.
FilePerms
I32Exit
An error returned from the proc_exit host syscall.
OpenMode
TrappableError
A helper error type used by many other modules through type aliases.
WasiCtx
Per-Store state which holds state necessary to implement WASI from this crate.
WasiCtxBuilder
Builder-style structure used to create a WasiCtx.
WasiCtxView
Structure returned from WasiView::ctx which provides accesss to WASI state for host functions to be implemented with.

Traits§

WasiView
A trait which provides access to the WasiCtx inside the embedder’s T of Store<T>.