wasmtime_wasi/
lib.rs

1#![cfg_attr(docsrs, feature(doc_auto_cfg))]
2
3//! # Wasmtime's WASI Implementation
4//!
5//! This crate provides a Wasmtime host implementations of different versions of WASI.
6//! WASI is implemented with the Rust crates [`tokio`] and [`cap-std`](cap_std) primarily, meaning that
7//! operations are implemented in terms of their native platform equivalents by
8//! default.
9//!
10//! For components and WASIp2, see [`p2`].
11//! For WASIp1 and core modules, see the [`preview1`] module documentation.
12//!
13//! For WASIp3, see [`p3`]. WASIp3 support is experimental, unstable and incomplete.
14
15pub mod cli;
16pub mod clocks;
17mod ctx;
18mod error;
19mod filesystem;
20#[cfg(feature = "p1")]
21pub mod p0;
22#[cfg(feature = "p1")]
23pub mod p1;
24// FIXME: should gate this module on the `p2` feature but that will require more
25// internal refactoring to get that aligned right.
26// #[cfg(feature = "p2")]
27pub mod p2;
28#[cfg(feature = "p3")]
29pub mod p3;
30pub mod random;
31pub mod runtime;
32pub mod sockets;
33mod view;
34
35pub use self::clocks::{HostMonotonicClock, HostWallClock};
36pub use self::ctx::{WasiCtx, WasiCtxBuilder};
37pub use self::error::{I32Exit, TrappableError};
38pub use self::filesystem::{DirPerms, FilePerms, OpenMode};
39pub use self::random::{Deterministic, thread_rng};
40pub use self::view::{WasiCtxView, WasiView};
41#[doc(no_inline)]
42pub use async_trait::async_trait;
43#[doc(no_inline)]
44pub use cap_fs_ext::SystemTimeSpec;
45#[doc(no_inline)]
46pub use cap_rand::RngCore;
47#[doc(no_inline)]
48pub use wasmtime::component::{ResourceTable, ResourceTableError};