Skip to main content

Module codegen_tswire

Module codegen_tswire 

Source
Expand description

The binary wire for TypeScript/JavaScript: generated JS encoders write arguments into a buffer registered once with the Rust module, the Rust side reads them in place, and the result comes back the same way. No JSON text, no per-property napi calls.

When an argument does not have the declared shape at run time, that call falls back to the JSON bridge, so behavior on unexpected inputs stays exactly as before.

Functionsยง

index_cjs
JS for index.cjs, after the exports are set: the runtime, and each wire function in front of its JSON version.
napi_rs
Rust code for lib.rs (napi): the wire runtime and one function per wire export; empty when no function uses the wire.
uses_wire
Whether the crate has wire functions (and needs src/wire.rs).
wired
The functions index.cjs sends over the wire: their wrapper also refuses lone surrogates and keeps JS error classes, in place of the guard layer.