Module closure_prepare

Source
Expand description

Closures provide a way to generate a WASM function that wraps a generic function and an environment.

A typical usage of this API is as follows:

  1. Allocate a function pointer for your closure with closure_allocate
  2. Prepare the closure with closure_prepare
  3. Call function pointer
  4. Call closure_prepare again to redefine the function pointer
  5. Notify wasmer that the closure is no longer needed with closure_free

Staticsยง

CLOSURE_ID ๐Ÿ”’

Traitsยง

ValTypeOps ๐Ÿ”’

Functionsยง

build_closure_wasm_bytes ๐Ÿ”’
Build a dynamically linkable WASM module for the given closure.
closure_prepare
Prepare a closure so that it can be called with a given signature.