class Wasmer::Module

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.cr

Constructors

Instance Method Summary

Constructor Detail

def self.deserialize(store : Store, bytes : Bytes) : Module #

Deserializes bytes to a Module


[View source]
def self.new(store : Store, bytes : Bytes) #

[View source]
def self.new(store : Store, wat : String) #

[View source]

Instance Method Detail

def exports : Array(ExportType) #

Returns the Module's exports as an ExportType array


[View source]
def imports : Array(ImportType) #

Returns the Module's imports as an ImportType array


[View source]
def name : String #

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


[View source]
def serialize : Bytes #

Serializes the module and returns the Wasm code as bytes


[View source]
def validate(store : Store, bytes : Bytes) : Nil #

Validates a new Module against the given store.


[View source]