class Wasmer::Module
- Wasmer::Module
- Reference
- Object
Overview
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
Defined in:
wasmer/module.crConstructors
-
.deserialize(store : Store, bytes : Bytes) : Module
Deserializes bytes to a Module
- .new(store : Store, bytes : Bytes)
- .new(store : Store, wat : String)
Instance Method Summary
-
#exports : Array(ExportType)
Returns the Module's exports as an
ExportType
array -
#imports : Array(ImportType)
Returns the Module's imports as an
ImportType
array -
#name : String
Returns the Module's name Note: This is not part of the standard Wasm C API.
-
#serialize : Bytes
Serializes the module and returns the Wasm code as bytes
-
#validate(store : Store, bytes : Bytes) : Nil
Validates a new
Module
against the given store.
Constructor Detail
Deserializes bytes to a Module
Instance Method Detail
Returns the Module's name Note: This is not part of the standard Wasm C API. It is Wasmer specific
Validates a new Module
against the given store.