Wasmtime (Wasmtime v0.3.0) View Source
Represents a Wasm instance powered by Wasmtime. The module can be loaded via bytes or a file path. Wasmtime will JIT compile, interpret and make it available. This Elixir module is backed by a GenServer for concurrency reasons and to keep state of the loaded instance.
Link to this section Summary
Functions
Call a Wasm function.
Call a Wasm function without using threads for specific low latency use cases. This function should only be used if you really have to save some extra microseconds, and the Wasm function is lightweight (takes less than < 1ms to execute). Also, the Wasm module can't have any imports when using this function.
Returns a specification to start this module under a supervisor.
List all Wasm types exported.
Get an exported Wasm function.
Load a Wasm module given bytes in memory or from a Wasm file. Both .wasm
and .wat
files are supported.
Link to this section Functions
Specs
Call a Wasm function.
Specs
Call a Wasm function without using threads for specific low latency use cases. This function should only be used if you really have to save some extra microseconds, and the Wasm function is lightweight (takes less than < 1ms to execute). Also, the Wasm module can't have any imports when using this function.
Returns a specification to start this module under a supervisor.
See Supervisor
.
Specs
List all Wasm types exported.
Specs
Get an exported Wasm function.
Specs
load( %Wasmtime.FromBytes{bytes: term(), config: term(), func_imports: term()} | %Wasmtime.FromFile{config: term(), file_path: term(), func_imports: term()} ) :: {atom(), pid()}
Load a Wasm module given bytes in memory or from a Wasm file. Both .wasm
and .wat
files are supported.
iex> {:ok, _pid} = Wasmtime.load(%Wasmtime.FromFile{file_path: "test/data/adder.wat"})