Struct nanowasm::loader::LoadedModule [] [src]

pub struct LoadedModule {
    pub name: String,
    pub types: Vec<FuncType>,
    pub funcs: Vec<Func>,
    pub start: Option<FuncIdx>,
    pub tables: Option<Table>,
    pub table_initializers: Vec<(ConstExpr, Vec<FuncIdx>)>,
    pub mem: Option<Memory>,
    pub mem_initializers: Vec<(ConstExpr, Vec<u8>)>,
    pub globals: Vec<(Global, ConstExpr)>,
    pub exported_functions: Vec<Export<FuncIdx>>,
    pub exported_tables: Option<Export<()>>,
    pub exported_memories: Option<Export<()>>,
    pub exported_globals: Vec<Export<GlobalIdx>>,
    pub imported_functions: Vec<Import<TypeIdx>>,
    pub imported_tables: Option<Import<TableType>>,
    pub imported_memories: Option<Import<MemoryType>>,
    pub imported_globals: Vec<Import<GlobalType>>,
}

A loaded wasm module

Fields

Module name. Not technically necessary, but handy.

Function type vector

Function value vector

Index of start function, if any.

wasm 1.0 defines only a single table. Even if we import some other table we can only do it if there's not an existing one, I think.

Initializer code for table (offset, values)

wasm 1.0 defines only a single memory.

Initializer code for data segments.

Global values.

Exported values

Imported values

Methods

impl LoadedModule
[src]

[src]

Instantiates and initializes a new module from the parity_wasm module type. This basically goes from a representation very close to the raw webassembly binary format to a representation more convenient to be loaded into the interpreter's runtime data.

Does NOT validate the module or run the start function though!

[src]

Adds a host function, plus an export for it. Not really ideal, but what can one do when parity-wasm doesn't handle them either? Hmmm.

[src]

Validates the module: makes sure types are correct, all the indices into various parts of the module are valid, etc.

TODO: Currently does nothing

Trait Implementations

impl Debug for LoadedModule
[src]

[src]

Formats the value using the given formatter. Read more

impl Clone for LoadedModule
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl !Send for LoadedModule

impl !Sync for LoadedModule