class

Wasmer::Module

Inherits Reference / Object

Module contains stateless WebAssembly code that has already been compiled and can be instantiated multiple times.

WebAssembly programs are organized into modules, which are the unit of deployment, loading, and compilation. A module collects definitions for types, functions, tables, memories, and globals. In addition, it can declare imports and exports and provide initialization logic in the form of data and element segments or a start function.

See also

Specification: https://webassembly.github.io/spec/core/syntax/modules.html#modules

Constructors

deserialize(store : Store, bytes : Bytes) : Module

Deserializes bytes to a Module

Source
new(store : Store, bytes : Bytes)
Source
new(store : Store, wat : String)
Source

Instance methods

exports

Returns the Module's exports as an ExportType array

Source
imports

Returns the Module's imports as an ImportType array

Source
name

Returns the Module's name Note: This is not part of the standard Wasm C API. It is Wasmer specific

Source
serialize

Serializes the module and returns the Wasm code as bytes

Source
validate(store : Store, bytes : Bytes) : Nil

Validates a new Module against the given store.

Source