- Enable functions to have a different name between Rust and C++ (#349)
- Within cxx::bridge, write #[rust_name = "..."] or #[cxx_name = "..."] to make a change to either name of a function
- In general many functions can have the same C++ name (due to overloading); every function must continue to have a unique Rust name
#[cxx::bridge]
mod ffi {
extern "C++" {
include!("path/to/header.h");
#[cxx_name = "take"]
fn take_int(i: i32);
#[cxx_name = "take"] // different overload of the same name in C++
fn take_str(s: &str);
}
}