Crubit is a C++/Rust interop tool. It has two parts:
cpp_api_from_rust.md describes how to enable C++ to call Rust. This direction of Crubit interop is fully supported in Chromium (but see the “Caveats” section below).rust_api_from_cpp enables Rust to call C++. It is not yet officially supported in Chromium. Information about partial, experimental support can be found in rust_api_from_cpp.md.Notes:
//docs/rust/ffi.md for an overview of other Rust interop tools (e.g. cxx or bindgen). These tools remain fully supported (i.e. there is no deprecation schedule that would require actively migrating existing cxx::bridge code to Crubit).Some directories cannot use Crubit: The Android project's Soong/bp build system does not support Crubit at this point. Consequently, Crubit cannot be used in //base, //net, or other directories that Cronet depends on. This is tracked in https://crbug.com/535682335.
2nd-party project limitations: In principle, Crubit will work in projects like PDFium or V8 as well. However, such projects usually support non-Chromium clients or alternative toolchains that may lack Crubit support. In order to use Crubit in a 2nd-party project, that project must first:
//build_overrides/crubit.gni.