package extism

  1. Overview
  2. Docs

Module Extism.FunctionSource

Function is used to create new a new function, which can be called from a WebAssembly plugin

Sourcetype t

Function type

Sourceval create : string -> ?namespace:string -> params:Val_type.t list -> results:Val_type.t list -> user_data:'a -> (Current_plugin.t -> Val_array.t -> Val_array.t -> 'a -> unit) -> t

Create a new function, Function.v name ~params ~results ~user_data f creates a new Function with the given name, params specifies the argument types, results specifies the return types, user_data is used to pass arbitrary OCaml values into the function and f is the OCaml function that will be called.

Sourceval with_namespace : t -> string -> t

Update a function's namespace

Sourceval free : t -> unit

Free a function

Sourceval free_all : t list -> unit

Free a list of functions

OCaml

Innovation. Community. Security.