Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

uniffi-rs is a suite of projects to allow Rust to be used from other languages. It was started at Mozilla to facilitate building cross-platform components in Rust which could be run on Android and iOS.

It has since grown to support for other languages not in use at Mozilla.

React Native Logo ↔️ Rust Logo

Typescript logo ↔️ WASM logo

uniffi-bindgen-react-native is the project that houses the bindings generators for React Native, the Web, and Node.js.

It supports all language features that uniffi-rs supports, including:

  • calling functions from Typescript to Rust, synchronous and asynchronous.
  • calling functions from Rust to Typescript, synchronous and asynchronous.
  • objects with methods, including:
    • garbage collection integration.
    • uniffi traits
  • custom types

It contains tooling to generate bindings:

  • for Hermes via JSI, and to generate the code to create turbo-modules.
  • for WASM, using wasm-bindgen, and the WASM crate.
  • for Node.js, calling a compiled cdylib through an N-API runtime.

New projects depend on the @ubjs runtime packages; see Packages for what to install. Code generated before those packages existed keeps working unchanged.

Warning

This project is still in early development, and should not yet be used in production.