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

Frees the context from memory and all of its plugins.

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

Resets the context. This has the effect of freeing all the plugins created so far.

Link to this function

wrap_resource(ptr)