Skip to main content

Module js_callback

Module js_callback 

Source
Expand description

Generic JavaScript-callback alias used by the host protocol exports.

Structs§

InvalidReturnValue
Used as the fallback branch in Either<Ret, InvalidReturnValue> to catch type mismatches from JS function options. Always passes NAPI validation so that when Ret validation fails, the error is handled in Rust with a clear message instead of becoming an uncatchable napi_fatal_exception.

Type Aliases§

JsCallback
JsCallback is a type alias for a weak, caller-handled ThreadsafeFunction whose return value is validated in Rust: it represents a JavaScript function passed to the Rust side.