Skip to main content

Crate wasmtime_wasi

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 p1 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::filesystem::DirPerms;
pub use self::filesystem::FilePerms;
pub use self::filesystem::OpenMode;
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
filesystem
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
p3p3
Experimental, unstable and incomplete implementation of wasip3 version of WASI.
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§

I32Exit
An error returned from the proc_exit host syscall.
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 access 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>.