Extism.Context (extism v0.5.0)
A Context is needed to create plugins. The Context is where your plugins live. Freeing the context frees all of the plugins in its scope.
Summary
Functions
Frees the context from memory and all of its plugins.
Creates a new context.
Create a new plugin from a WASM module or manifest
Resets the context. This has the effect of freeing all the plugins created so far.
Functions
Link to this function
free(ctx)
Frees the context from memory and all of its plugins.
Link to this function
new()
Creates a new context.
Link to this function
new_plugin(ctx, manifest, wasi \\ false)
Create a new plugin from a WASM module or manifest
Examples:
iex> ctx = Extism.Context.new()
iex> manifest = %{ wasm: [ %{ path: "/Users/ben/code/extism/wasm/code.wasm" } ]}
iex> {:ok, plugin} = Extism.Context.new_plugin(ctx, manifest, false)
Parameters
- ctx: The Context to manage this plugin
- manifest: The String or Map of the WASM module or manifest
- wasi: A bool you set to true if you want WASI support
Link to this function
reset(ctx)
Resets the context. This has the effect of freeing all the plugins created so far.
Link to this function