pub fn execute_binary(
    wasm_binary: Vec<u8>,
    args: Vec<String>,
    preopen_dirs: Vec<String>
) -> isize
Expand description

Executes a WASI-compliant WebAssembly binary.

This function constructs a wasmi state machine from a WebAssembly binary, constructs a HostExternals object consisting of any necessary Theseus or wasmi I/O, opens file descriptors for accessible directories, and executes.

Arguments

  • wasm_binary: a WASI-compliant WebAssembly binary as a byte vector
  • args: a POSIX-formatted string vector of arguments to WebAssembly binary
  • preopen_dirs: a string vector of directory paths to grant WASI access to