package extism

  1. Overview
  2. Docs

Plugins contain functions that can be called

type t
val create : ?config:Manifest.config -> ?wasi:bool -> ?functions:Function.t list -> Context.t -> string -> (t, Error.t) result

Make a new plugin from raw WebAssembly or JSON encoded manifest

val of_manifest : ?wasi:bool -> ?functions:Function.t list -> Context.t -> Manifest.t -> (t, Error.t) result

Make a new plugin from a Manifest

val update : t -> ?config:(string * string option) list -> ?wasi:bool -> ?functions:Function.t list -> string -> (unit, [ `Msg of string ]) result

Update a plugin from raw WebAssembly or JSON encoded manifest

val update_manifest : t -> ?wasi:bool -> Manifest.t -> (unit, Error.t) result

Update a plugin from a Manifest

val call_bigstring : t -> name:string -> Bigstringaf.t -> (Bigstringaf.t, Error.t) result

Call a function, uses Bigstringaf.t for input/output

val call : t -> name:string -> string -> (string, Error.t) result

Call a function, uses string for input/output

val free : t -> unit

Drop a plugin

val function_exists : t -> string -> bool

Check if a function is exported by a plugin

module Cancel_handle : sig ... end
val cancel_handle : t -> Cancel_handle.t
OCaml

Innovation. Community. Security.