1 unstable release
new 0.29.0-0 | Apr 29, 2025 |
---|
#198 in FFI
12KB
194 lines
uniffi-runtime-javascript
The command line tool uniffi-bindgen-react-native
can generate Javascript bindings crate for your
Rust crate, from [uniffi::export]
proc-macros in your code.
These bindings crates depend on this crate. Currently this is for WASM runtimes only.
This crate is not intended to be used directly by hand-written code.
If you find this crate from a Cargo.toml
, it is almost certain that the crate will have
been generated.
For more information visit: https://jhugman.github.io/uniffi-bindgen-react-native
What is uniffi
?
uniffi
is a multi-language bindings generator for Rust, started at, and maintained by Mozilla.
For more information visit: https://mozilla.github.io/uniffi-rs
Most uniffi generated bindings go through a C ABI, called through different languages C FFI facilities. This crate is the beginnings of using Rust to call in to the C ABI.
Features
The crate is split into features, one per Javascript runtime:
wasm32
: useswasm-bindgen
.
Future features may be:
napi
: which usesnapi-rs
to provide node bindings.
Generating uniffi
based bindings for other Javascript Runtimes without this crate
uniffi-bindgen-react-native
generates C++ for the Hermes JS engine used by React Native.- internally, Firefox uses uniffi to generate bindings for privileged JS.
Dependencies
~0.5–0.8MB
~13K SLoC