Skip to content

Navigating the code

The code for UniFFI is organized into the following crates:

  • ./uniffi (docs.rs, source): The main entry-point to UniFFI - almost all consumers should be able to use facilities expored by this module.

  • ./uniffi_bindgen (docs.rs, source): The the source for the uniffi-bindgen executable and is where most of the logic for the foreign bindings generation lives. Its contents include:

  • ./uniffi_meta(docs.rs, source): The types used to represent the metadata used to describe the ComponentInterface used to generate the Rust scaffolding and the foreign bindings.

  • ./uniffi_udl(docs.rs, source) : The parsing of UDL files, turning them into uniffi_meta types.

  • ./uniffi_build(docs.rs, source): A small hook to run uniffi-bindgen from the build.rs script of a UniFFI component, in order to automatically generate the Rust scaffolding as part of its build process.

  • ./uniffi_macros(docs.rs, source): Contains the proc_macro support, which does much of the heavy-lifting for defining the Rust FFI.

  • ./examples: Contains code examples demonstrating the capabilites and code generation process.

  • ./fixtures: Our test suite.