class

Wasmer::Wasi::StateBuilder

Inherits Reference / Object

Convenient API for configuring WASI

Class methods

builder(program_name : String, &) : Environment
Source

Instance methods

build

Builds the state builder to produce a WasiEnvironment. It consumes the current WasiStateBuilder

Source
with_arg(argument : String)

Configures a new argument to the WASI module

Source
with_capture_stderr

Configures the WASI module to capture its STDERR

Source
with_capture_stdout

Configures the WASI module to capture its STDOUT

Source
with_env(key : String, value : String)

Configures a new environment variable for the WASI module

Source
with_inherit_stderr

Configures the WASI module to inherit the STDERR from the host

Source
with_inherit_stdin

Configures the WASI module to inherit the STDIN from the host

Source
with_inherit_stdout

Configures the WASI module to inherit the STDOUT from the host

Source
with_map_dir(_alias : String, dir : String)

Configures a new directory to pre-open with a different name exposed to the WASI module.

Source
with_preopen_dir(dir : String)

Configures a new directory to pre-open.

This opens the given directory at the virtual root /, and allows the WASI module to read and write to the given directory.

Source