Bindgen is the most popular and mature tool and is maintained by the Rust project. It is used to create bindings for C code (and some C++) in Rust code. Cbindgen can be used to create C bindings to Rust code. The other tools below are for C++ interop; cxx is the current favourite tool with the community, but is not suitable for all use cases.
- cxx, repo
- autocxx (Google tool for 'integrating cxx with bindgen')
- rust-cpp (
- flapigen (formerly Swig)
- ABI Cafe for comparing the output of compilers for ABI compatibility
- crubit experimental C++ interop from Chrome folk
You may want to use COM/WinRT for inter-language interaction, the best Rust support for COM and WinRT is in windows-rs.
- Nomicon chapter
- Unofficial FFI guide
- FFI omnibus
- Firefox docs for C++ interop
- FFI idioms and patterns
- Chrome docs for C++ interop
- FFI chapter in ANSSI-FR Secure Rust Guidelines
Resources for learning about unsafe programming: