Store

class Store

The runtime storage for all function, global, memory, table instances.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
data class QualifiedName(module: String, name: String)

QualifiedName is internally used to use pairs (moduleName, name) as keys in the store.

Properties

Functions

Link copied to clipboard
fun addFunction(vararg function: ImportFunction): Store

Add a function to the store.

Link copied to clipboard
fun addGlobal(vararg global: ImportGlobal): Store

Add a global to the store.

Link copied to clipboard
fun addImportValues(importValues: ImportValues): Store

Add the contents of an ImportValues instance to the store.

Link copied to clipboard
fun addMemory(vararg memory: ImportMemory): Store

Add a memory to the store.

Link copied to clipboard
fun addTable(vararg table: ImportTable): Store

Add a table to the store.

Link copied to clipboard
fun addTag(vararg tag: ImportTag): Store

Add a tag to the store.

Link copied to clipboard
fun instantiate(name: String, instanceFactory: (ImportValues) -> Instance): Instance

Creates an instance with the given factory and registers the result in the store.

fun instantiate(name: String, module: WasmModule): Instance

A shorthand for instantiating a module and registering it in the store.

Link copied to clipboard
fun register(name: String, instance: Instance): Store

Register an instance in the store with the given name. All the exported functions, globals, memories, and tables are added to the store with the given name.

Link copied to clipboard

Convert the contents of a store to an ImportValues instance.