Wasmex.Wasi.WasiP2Options (wasmex v0.13.0)
Configures WASI P2 support for a Wasmex.Components.Store.
WASI (WebAssembly System Interface) P2 provides system interface capabilities to WebAssembly components, allowing them to interact with the host system in a controlled manner.
Options
:inherit_stdin- Whentrue, allows the component to read from standard input. Defaults totrue.:inherit_stdout- Whentrue, allows the component to write to standard output. Defaults totrue.:inherit_stderr- Whentrue, allows the component to write to standard error. Defaults totrue.:allow_http- Whentrue, enables HTTP capabilities for the component. Defaults tofalse.:args- List of command-line arguments to pass to the component. Defaults to[].:env- Map of environment variables to make available to the component. Defaults to%{}.
Example
iex> wasi_opts = %Wasmex.Wasi.WasiP2Options{
...> args: ["--verbose"],
...> env: %{"DEBUG" => "1"},
...> allow_http: true
...> }
iex> {:ok, pid} = Wasmex.Components.start_link(%{
...> path: "my_component.wasm",
...> wasi: wasi_opts
...> })