1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! # 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`](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.
/// The maximum size, in bytes, that this crate will allocate on the host on a
/// per-read basis.
///
/// This is used to limit the size of `wasi:io/streams.input-stream#read`, for
/// example, along with a variety of other read-style APIs. All of these APIs
/// have the shape where the guest asks the host to read some data for it, and
/// then it's returned. The data is allocated on the host, however, meaning that
/// when the guest asks for an extremely large read that could cause a very
/// large allocations on the host. For now this constant serves as a hard limit
/// on the size of the allocation a host will make.
///
/// TODO: make this configurable per-I/O? Per-WASI? It's not great that this
/// just a hard and unconfigurable limit. There are probably situations where
/// performance will be improved if this limit were higher or removed. Doing so
/// without exposing hosts to guest-controlled resource exhaustion is the
/// important part, though.
const MAX_READ_SIZE_ALLOC: usize = 64 * 1024;
// FIXME: should gate this module on the `p2` feature but that will require more
// internal refactoring to get that aligned right.
// #[cfg(feature = "p2")]
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use async_trait;
pub use SystemTimeSpec;
pub use RngCore;
pub use ;