Extism.Context (extism v0.3.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.

Link to this section 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.

Link to this section 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

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

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)