Skip to main content

Crate js2rust_bridge_macro

Crate js2rust_bridge_macro 

Source
Expand description

Proc-macro for generating Rust FFI bindings from js2rust C ABI export metadata.

§Usage

ⓘ
js2rust_bridge!();

The macro reads js2rust.toml from the crate root, transpiles JS to Zig, writes output to .js2zig-cache/{group}/, and generates Rust FFI bindings. The group name is derived from the file name (sanitized for Zig identifiers). A minimal build.rs only needs js2rust_bridge::build(false).

Macros§

js2rust_bridge
Function-like proc-macro: js2rust_bridge!().

Attribute Macros§

host_fn
#[host_fn] attribute macro — eliminates unsafe C ABI plumbing from host functions.