Function promising

pub fn promising(func: &Function) -> Function

Wraps a WebAssembly exported Function so that calling it returns a Promise and enables JSPI suspension inside.

Use WebAssembly.promising to obtain a "promising" wrapper around a raw WASM export; any JSPI suspensions that occur while the function executes will resolve the returned Promise when the fiber finishes.

MDN documentation