Expand description
Elements of the WebAssembly binary format.
Modules
Structs
- Section with function bodies of the module.
- List for reading sequence of elements typed
T
, given they are preceded by length (serialized as VarUint32). - Helper struct to write series of
T
preceded by the length of the sequence serialized as VarUint32. - Helper struct to write payload which is preceded by it’s own length in bytes.
- Custom section.
- Data entries definitions.
- Data segment definition.
- Element entries section.
- Entry in the element section.
- Export entry.
- List of exports definition.
- Function signature (type reference)
- Function body definition.
- The names of the functions in this module.
- Section with function signatures definition.
- Function signature type.
- Global entry in the module.
- Globals definition section.
- Global definition struct
- Import entry.
- Section of the imports definition.
- A map from non-contiguous
u32
keys to values of typeT
, which is serialized and deserialized ascending order of the keys. Normally used for relative dense maps with occasional “holes”, and stored as an array. - Initialization expression.
- List of instructions (usually inside a block section).
- Local definition inside the function body.
- The names of the local variables in this module’s functions.
- Section with table definition (currently only one entry is allowed).
- Memory entry.
- WebAssembly module
- The name of this module.
- Debug name information.
- Relocation information.
- Memory and table limits.
- Section with table definition (currently only one is allowed).
- Table entry
- Section with type declarations.
- 8-bit unsigned integer, NOT encoded in LEB128; it’s just a single byte.
- 32-bit unsigned integer, encoded in little endian.
- 64-bit unsigned integer, encoded in little endian.
- Unparsed part of the module/section.
- 7-bit signed integer, encoded in LEB128 (always 1 byte length)
- 32-bit signed integer, encoded in LEB128 (can be 1-5 bytes length).
- 64-bit signed integer, encoded in LEB128 (can be 1-9 bytes length).
- VarUint1, 1-bit value (0/1).
- 7-bit unsigned integer, encoded in LEB128 (always 1 byte length).
- Unsigned variable-length integer, limited to 32 bits, represented by at most 5 bytes that may contain padding 0x80 bytes.
- Unsigned variable-length integer, limited to 64 bits, represented by at most 9 bytes that may contain padding 0x80 bytes.
Enums
- Block type which is basically
ValueType
+ NoResult (to define blocks that have no return type) - Deserialization/serialization error
- External to local binding.
- Type of the import entry to count
- Instruction.
- Internal reference of the exported entry.
- Relocation entry.
- Section in the WebAssembly module.
- Table element type.
- Type definition in types section. Currently can be only of the function type.
- Value type.
Traits
- Deserialization from serial i/o.
- Serialization to serial i/o. Takes self by value to consume less memory (parity-wasm IR is being partially freed by filling the result buffer).
Functions
- Deserialize deserializable type from buffer.
- Deserialize module from the file.
- Returns size of the module in the provided stream.
- Create buffer with serialized value.
- Serialize module to the file
Type Aliases
- A map from indices to names.