xref: /wasmtime-44.0.1/crates/wasi/src/lib.rs (revision bda02c19)
1 #![cfg_attr(docsrs, feature(doc_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 [`p1`] module documentation.
12 //!
13 //! For WASIp3, see [`p3`]. WASIp3 support is experimental, unstable and incomplete.
14 
15 pub mod cli;
16 pub mod clocks;
17 mod ctx;
18 mod error;
19 pub mod filesystem;
20 #[cfg(feature = "p1")]
21 pub mod p0;
22 #[cfg(feature = "p1")]
23 pub 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")]
27 pub mod p2;
28 #[cfg(feature = "p3")]
29 pub mod p3;
30 pub mod random;
31 pub mod runtime;
32 pub mod sockets;
33 mod view;
34 
35 pub use self::clocks::{HostMonotonicClock, HostWallClock};
36 pub use self::ctx::{WasiCtx, WasiCtxBuilder};
37 pub use self::error::{I32Exit, TrappableError};
38 pub use self::filesystem::{DirPerms, FilePerms, OpenMode};
39 pub use self::random::{Deterministic, thread_rng};
40 pub use self::view::{WasiCtxView, WasiView};
41 #[doc(no_inline)]
42 pub use async_trait::async_trait;
43 #[doc(no_inline)]
44 pub use cap_fs_ext::SystemTimeSpec;
45 #[doc(no_inline)]
46 pub use cap_rand::RngCore;
47 #[doc(no_inline)]
48 pub use wasmtime::component::{ResourceTable, ResourceTableError};
49