pub enum ModuleSection {
Show 13 variants
Custom = 0,
Type = 1,
Import = 2,
Function = 3,
Table = 4,
Memory = 5,
Global = 6,
Export = 7,
Start = 8,
Element = 9,
Code = 10,
Data = 11,
DataCount = 12,
}Expand description
The binary encoding of modules is organized into sections. Most sections correspond to one component of a module record, except that function definitions are split into two sections, separating their type declarations in the function section from their bodies in the code section.
See https://webassembly.github.io/spec/core/binary/modules.html
VariantsΒ§
Custom = 0
Custom sections have the id 0. They are intended to be used for debugging information or third-party extensions, and are ignored by the WebAssembly semantics. Their contents consist of a name further identifying the custom section, followed by an uninterpreted sequence of bytes for custom use.
Type = 1
The type section has the id 1. It decodes into a vector of function types that represent the ππππΎπ component of a module.
Import = 2
The import section has the id 2. It decodes into a vector of imports that represent the πππππππ component of a module.
Function = 3
The function section has the id 3. It decodes into a vector of type indices that represent the ππππΎ fields of the functions in the πΏπππΌπ component of a module. The π ππΌπΊπ π and π»ππ½π fields of the respective functions are encoded separately in the code section.
Table = 4
The table section has the id 4. It decodes into a vector of tables that represent the ππΊπ»π πΎπ component of a module.
Memory = 5
The memory section has the id 5. It decodes into a vector of memories that represent the ππΎππ component of a module.
Global = 6
The global section has the id 6. It decodes into a vector of globals that represent the ππ ππ»πΊπ π component of a module.
Export = 7
The export section has the id 7. It decodes into a vector of exports that represent the πΎππππππ component of a module.
Start = 8
The start section has the id 8. It decodes into an optional start function that represents the πππΊππ component of a module.
Element = 9
The element section has the id 9. It decodes into a vector of element segments that represent the πΎπ πΎππ component of a module.
Code = 10
The code section has the id 10. It decodes into a vector of code entries that are pairs of value type vectors and expressions. They represent the π ππΌπΊπ π and π»ππ½π field of the functions in the πΏπππΌπ component of a module. The ππππΎ fields of the respective functions are encoded separately in the function section.
Data = 11
The data section has the id 11. It decodes into a vector of data segments that represent the π½πΊππΊπ component of a module.
DataCount = 12
The data count section has the id 12. It decodes into an optional u32 that represents the number of data segments in the data section. If this count does not match the length of the data segment vector, the module is malformed.
Trait ImplementationsΒ§
SourceΒ§impl Clone for ModuleSection
impl Clone for ModuleSection
SourceΒ§fn clone(&self) -> ModuleSection
fn clone(&self) -> ModuleSection
1.0.0 Β· SourceΒ§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more