]>
Commit | Line | Data |
---|---|---|
064997fb FG |
1 | //! Raw API bindings to the WebAssembly System Interface (WASI) |
2 | //! | |
3 | //! This crate provides Rust API bindings to WASI APIs. All WASI APIs are | |
4 | //! exported from this crate and provided with the appropriate type signatures. | |
5 | //! This crate is entirely procedurally generated from the `*.witx` files that | |
6 | //! describe the WASI API. | |
7 | //! | |
8 | //! # WASI API Version | |
9 | //! | |
10 | //! The WASI API is evolving over time. It is both gaining new features as well | |
11 | //! as tweaking the ABI of existing features. As a result it's important to | |
12 | //! understand what version of this crate you're using and how it relates to | |
13 | //! the WASI version of the spec. | |
14 | //! | |
15 | //! The WASI specification is organized into phases where there is a snapshot | |
16 | //! at any one point in time describing the current state of the specification. | |
17 | //! This crate implements a particular snapshot. You can find the snapshot | |
18 | //! version implemented in this crate in the build metadata of the crate | |
19 | //! version number. For example something like `0.9.0+wasi-snapshot-preview1` | |
20 | //! means that this crate's own personal version is 0.9.0 and it implements the | |
21 | //! `wasi-snapshot-preview1` snapshot. A major release of this crate (i.e. | |
22 | //! bumping the "0.9.0") is expected whenever the generated code changes | |
23 | //! or a new WASI snapshot is used. | |
24 | //! | |
25 | //! # Crate Features | |
26 | //! | |
27 | //! This crate supports one feature, `std`, which implements the standard | |
28 | //! `Error` trait for the exported [`Error`] type in this crate. This is | |
29 | //! enabled by default but can be disabled to make the library `no_std` | |
30 | //! compatible. | |
31 | ||
32 | #![no_std] | |
33 | ||
34 | mod error; | |
35 | mod lib_generated; | |
36 | pub use lib_generated::*; | |
37 | ||
38 | /// Special `Dircookie` value indicating the start of a directory. | |
39 | pub const DIRCOOKIE_START: Dircookie = 0; | |
40 | ||
41 | /// The "standard input" descriptor number. | |
42 | pub const FD_STDIN: Fd = 0; | |
43 | ||
44 | /// The "standard output" descriptor number. | |
45 | pub const FD_STDOUT: Fd = 1; | |
46 | ||
47 | /// The "standard error" descriptor number. | |
48 | pub const FD_STDERR: Fd = 2; |