wasp_vm v0.7.0 WaspVM View Source

Execute WebAssembly code

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor

Call an exported function by name from the VM. The function must have been loaded in through a module using load_file/2 or load/2 previously

Load a WebAssembly module directly from a binary into the VM

Load a binary WebAssembly file (.wasm) as a module into the VM

Starts the Virtual Machine and returns the PID which is used to interface with the VM

Returns the state for a given VM instance

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

execute(ref, func, args \\ []) View Source
execute(pid(), String.t(), list()) :: :ok | {:ok, any()} | {:error, any()}

Call an exported function by name from the VM. The function must have been loaded in through a module using load_file/2 or load/2 previously

Link to this function

load(ref, binary) View Source
load(pid(), binary()) :: :ok

Load a WebAssembly module directly from a binary into the VM

Link to this function

load_file(ref, filename) View Source
load_file(pid(), String.t()) :: :ok

Load a binary WebAssembly file (.wasm) as a module into the VM

Link to this function

start() View Source
start() :: {:ok, pid()}

Starts the Virtual Machine and returns the PID which is used to interface with the VM.

Link to this function

vm_state(ref) View Source
vm_state(pid()) :: WaspVM

Returns the state for a given VM instance