class Wasmer::Wasi::StateBuilder

Overview

Convenient API for configuring WASI

Defined in:

wasmer/wasi.cr

Class Method Summary

Instance Method Summary

Class Method Detail

def self.builder(program_name : String, &) : Environment #

[View source]

Instance Method Detail

def build #

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


[View source]
def with_arg(argument : String) #

Configures a new argument to the WASI module


[View source]
def with_capture_stderr #

Configures the WASI module to capture its STDERR


[View source]
def with_capture_stdout #

Configures the WASI module to capture its STDOUT


[View source]
def with_env(key : String, value : String) #

Configures a new environment variable for the WASI module


[View source]
def with_inherit_stderr #

Configures the WASI module to inherit the STDERR from the host


[View source]
def with_inherit_stdin #

Configures the WASI module to inherit the STDIN from the host


[View source]
def with_inherit_stdout #

Configures the WASI module to inherit the STDOUT from the host


[View source]
def with_map_dir(_alias : String, dir : String) #

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


[View source]
def 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.


[View source]