ChicoryWasiPreview1Builder

WASI Preview 1 host function installer.

Sets up WebAssembly host imports that provide WASI Preview 1 implementations.

Usage example:

// Prepare WASI host imports
val wasiImports: List<HostFunction> = ChicoryWasiPreview1Builder {
host = embedderHost
}.build()

val hostImports = ImportValues.builder().withFunctions(wasiImports).build()

// Instantiate the WebAssembly module
val instance = Instance
.builder(wasmModule)
.withImportValues(hostImports)
.withInitialize(true)
.withStart(false)
.build()

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Implementation of a host object that provides access from the WebAssembly to external host resources.

Link copied to clipboard

Sets memory provider used for all operations. For multi-memory scenarios.

Functions

Link copied to clipboard
fun build(moduleName: String = WASI_SNAPSHOT_PREVIEW1_MODULE_NAME): List<@JvmSuppressWildcards HostFunction>
Link copied to clipboard

Sets the host object that provides access from the WebAssembly to external host resources.

Link copied to clipboard

Sets memory provider used for all operations. For multi-memory scenarios.