wasm/core/structure/mod.rs
1//! # Abstract Syntax
2//!
3//! The Wasm specification defines an abstract syntax that is produced through the processes of
4//! decoding and parsing[^structure]. Afterwards, this abstract syntax is validated according to
5//! [^validation].
6//!
7//! However, this interpreter combines the decoding and validation phases into one function
8//! [`decode_and_validate`](crate::decode_and_validate). Therefore, we are not bound to produce the
9//! same, potentially invalid, intermediate abstract syntax that is defined in [^structure], but
10//! rather a more specific version of it that is always valid.
11//!
12//! This module defines such a valid abstract syntax. Note that in most places our valid abstract
13//! syntax uses the same definitions from the official abstract syntax, with validation invariants
14//! documented through Rust's safety mechanisms (to be relied on later during execution).
15//!
16//! [^structure]: [WebAssembly Specification 2.0 - 2. Structure](https://www.w3.org/TR/2025/CRD-wasm-core-2-20250616/#structure%E2%91%A0)
17//! [^validation]: [WebAssembly Specification 2.0 - 3. Validation](https://www.w3.org/TR/2025/CRD-wasm-core-2-20250616/#validation%E2%91%A1)
18
19pub mod instructions;
20pub mod modules;
21pub mod types;
22// TODO this module technically belongs to validation
23pub mod import_subtyping;