pub struct Module {
    pub signatures: PrimaryMap<SignatureIndex, Signature>,
    pub imported_funcs: PrimaryMap<FuncIndex, (String, String)>,
    pub imported_tables: PrimaryMap<TableIndex, (String, String)>,
    pub imported_memories: PrimaryMap<MemoryIndex, (String, String)>,
    pub imported_globals: PrimaryMap<GlobalIndex, (String, String)>,
    pub functions: PrimaryMap<FuncIndex, SignatureIndex>,
    pub table_plans: PrimaryMap<TableIndex, TablePlan>,
    pub memory_plans: PrimaryMap<MemoryIndex, MemoryPlan>,
    pub globals: PrimaryMap<GlobalIndex, Global>,
    pub exports: HashMap<String, Export>,
    pub start_func: Option<FuncIndex>,
    pub table_elements: Vec<TableElements>,
}
Expand description

A translated WebAssembly module, excluding the function bodies and memory initializers.

Fields§

§signatures: PrimaryMap<SignatureIndex, Signature>

Unprocessed signatures exactly as provided by declare_signature().

§imported_funcs: PrimaryMap<FuncIndex, (String, String)>

Names of imported functions.

§imported_tables: PrimaryMap<TableIndex, (String, String)>

Names of imported tables.

§imported_memories: PrimaryMap<MemoryIndex, (String, String)>

Names of imported memories.

§imported_globals: PrimaryMap<GlobalIndex, (String, String)>

Names of imported globals.

§functions: PrimaryMap<FuncIndex, SignatureIndex>

Types of functions, imported and local.

§table_plans: PrimaryMap<TableIndex, TablePlan>

WebAssembly tables.

§memory_plans: PrimaryMap<MemoryIndex, MemoryPlan>

WebAssembly linear memory plans.

§globals: PrimaryMap<GlobalIndex, Global>

WebAssembly global variables.

§exports: HashMap<String, Export>

Exported entities.

§start_func: Option<FuncIndex>

The module “start” function, if present.

§table_elements: Vec<TableElements>

WebAssembly table initializers.

Implementations§

Allocates the module data structures.

Convert a DefinedFuncIndex into a FuncIndex.

Convert a FuncIndex into a DefinedFuncIndex. Returns None if the index is an imported function.

Test whether the given function index is for an imported function.

Convert a DefinedTableIndex into a TableIndex.

Convert a TableIndex into a DefinedTableIndex. Returns None if the index is an imported table.

Test whether the given table index is for an imported table.

Convert a DefinedMemoryIndex into a MemoryIndex.

Convert a MemoryIndex into a DefinedMemoryIndex. Returns None if the index is an imported memory.

Test whether the given memory index is for an imported memory.

Convert a DefinedGlobalIndex into a GlobalIndex.

Convert a GlobalIndex into a DefinedGlobalIndex. Returns None if the index is an imported global.

Test whether the given global index is for an imported global.

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.