wry-bindgen-core
wry-bindgen-core is the minimal, stable API that wry-bindgen builds on. It exposes typed handles for talking to JavaScript: functions you can call, Rust values you can store and borrow back, and closures you can hand to JavaScript.
#
# ;
#
use with_runtime;
// Store a native Rust value and get back an opaque handle...
let handle = with_runtime;
// ...then borrow it back by handle later.
with_runtime;
What it provides
JsFunction<F>— a typed handle to a JavaScript function..call(args)runs the round-trip and returns the typed result.Runtimeandwith_runtime— a typed object store: insert a Rust value for anObjectHandle, borrow it back, or remove it.LazyCell<T>/JsThreadLocal<T>— typed runtime-local JavaScript values, such as the globalwindow.CallbackKey<F>— registers a Rust closure with JavaScript, with Rust-owned, JS-owned, and JS-owned-once policies.Clamped,BatchableResult, andRequireFlush— markers used when encoding arguments and return values.
Most of these are driven by the code wry-bindgen's macro generates; the object store reached through with_runtime is the part you tend to use directly.