Expand description
Elements of the WebAssembly binary format.
Modules§
Structs§
- BrTable
Data - Code
Section - Section with function bodies of the module.
- Counted
List - List for reading sequence of elements typed
T
, given they are preceded by length (serialized as VarUint32). - Counted
List Writer - Helper struct to write series of
T
preceded by the length of the sequence serialized as VarUint32. - Counted
Writer - Helper struct to write payload which is preceded by it’s own length in bytes.
- Custom
Section - Custom section.
- Data
Section - Data entries definitions.
- Data
Segment - Data segment definition.
- Element
Section - Element entries section.
- Element
Segment - Entry in the element section.
- Export
Entry - Export entry.
- Export
Section - List of exports definition.
- Func
- Function signature (type reference)
- Func
Body - Function body definition.
- Function
Name Subsection - The names of the functions in this module.
- Function
Section - Section with function signatures definition.
- Function
Type - Function signature type.
- Global
Entry - Global entry in the module.
- Global
Section - Globals definition section.
- Global
Type - Global definition struct
- Import
Entry - Import entry.
- Import
Section - Section of the imports definition.
- Index
Map - 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. - Init
Expr - Initialization expression.
- Instructions
- List of instructions (usually inside a block section).
- Local
- Local definition inside the function body.
- Local
Name Subsection - The names of the local variables in this module’s functions.
- Memory
Section - Section with table definition (currently only one entry is allowed).
- Memory
Type - Memory entry.
- Module
- WebAssembly module
- Module
Name Subsection - The name of this module.
- Name
Section - Debug name information.
- Reloc
Section - Relocation information.
- Resizable
Limits - Memory and table limits.
- Table
Section - Section with table definition (currently only one is allowed).
- Table
Type - Table entry
- Type
Section - Section with type declarations.
- Uint8
- 8-bit unsigned integer, NOT encoded in LEB128; it’s just a single byte.
- Uint32
- 32-bit unsigned integer, encoded in little endian.
- Uint64
- 64-bit unsigned integer, encoded in little endian.
- Unparsed
- Unparsed part of the module/section.
- VarInt7
- 7-bit signed integer, encoded in LEB128 (always 1 byte length)
- VarInt32
- 32-bit signed integer, encoded in LEB128 (can be 1-5 bytes length).
- VarInt64
- 64-bit signed integer, encoded in LEB128 (can be 1-9 bytes length).
- VarUint1
- VarUint1, 1-bit value (0/1).
- VarUint7
- 7-bit unsigned integer, encoded in LEB128 (always 1 byte length).
- VarUint32
- Unsigned variable-length integer, limited to 32 bits, represented by at most 5 bytes that may contain padding 0x80 bytes.
- VarUint64
- Unsigned variable-length integer, limited to 64 bits, represented by at most 9 bytes that may contain padding 0x80 bytes.
Enums§
- Block
Type - Block type which is basically
ValueType
+ NoResult (to define blocks that have no return type) - Error
- Deserialization/serialization error
- External
- External to local binding.
- Import
Count Type - Type of the import entry to count
- Instruction
- Instruction.
- Internal
- Internal reference of the exported entry.
- Relocation
Entry - Relocation entry.
- Section
- Section in the WebAssembly module.
- Sign
ExtInstruction - Table
Element Type - Table element type.
- Type
- Type definition in types section. Currently can be only of the function type.
- Value
Type - Value type.
Traits§
- Deserialize
- Deserialization from serial i/o.
- Serialize
- 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_
buffer - Deserialize deserializable type from buffer.
- deserialize_
file - Deserialize module from the file.
- peek_
size - Returns size of the module in the provided stream.
- serialize
- Create buffer with serialized value.
- serialize_
to_ file - Serialize module to the file
Type Aliases§
- NameMap
- A map from indices to names.