wasmer_interface_types/lib.rs
1//! This crate contains an implementation of [WebAssembly Interface
2//! Types][wit] (abbreviated WIT). It is composed of 5 parts:
3//!
4//! 1. [Types] and [Values]: To represent the WIT types and values
5//! representations,
6//! 2. [AST]: To represent the WIT language as a tree
7//! (which is not really abstract). This is the central
8//! representation of the language.
9//! 3. [Decoders](decoders): To read the [AST] from a particular data
10//! representation; for instance, [`decoders::binary::parse`] reads
11//! the [AST] from a binary.
12//! 4. [Encoders](encoders): To write the [AST](ast) into a particular
13//! format; for instance, [`encoders::wat`] writes the [AST] into a
14//! string representing WIT with its textual format.
15//! 5. [Interpreter](interpreter): WIT defines a concept called
16//! Adapters. An adapter contains a set of [instructions]. So, in
17//! more details, this module contains:
18//! * [A very light and generic stack
19//! implementation](interpreter::stack), exposing only the
20//! operations required by the interpreter,
21//! * [A stack-based interpreter](interpreter::Interpreter),
22//! defined by:
23//! * A compiler that transforms a set of instructions into a
24//! set of executable instructions,
25//! * A stack,
26//! * A runtime that holds the “invocation inputs” (arguments
27//! of the interpreter), the stack, and the WebAssembly
28//! instance (which holds the exports, the imports, the
29//! memories, the tables etc.),
30//! * [An hypothetic WebAssembly runtime](interpreter::wasm),
31//! represented as a set of enums, types, and traits —basically
32//! this is the part a runtime should take a look to use the
33//! `wasmer-interface-types` crate—.
34//!
35//! [wit]: https://github.com/WebAssembly/interface-types
36//! [Types]: types
37//! [Values]: values
38//! [AST]: ast
39//! [instructions]: interpreter::Instruction
40
41#![deny(
42 dead_code,
43 intra_doc_link_resolution_failure,
44 missing_docs,
45 nonstandard_style,
46 unreachable_patterns,
47 unused_imports,
48 unused_mut,
49 unused_unsafe,
50 unused_variables
51)]
52#![forbid(unsafe_code)]
53#![doc(html_favicon_url = "https://wasmer.io/static/icons/favicon.ico")]
54#![doc(html_logo_url = "https://github.com/wasmerio.png")]
55
56pub mod ast;
57pub mod types;
58#[macro_use]
59mod macros;
60pub mod decoders;
61pub mod encoders;
62pub mod errors;
63pub mod interpreter;
64#[cfg(feature = "serde")]
65mod serde;
66pub mod values;
67pub mod vec1;