The Rust bindings for a C++ declaration can be customized using an attribute macro from "support/annotations.h".
For instance:
unsafe in Rust, even if Crubit would otherwise assume it was safe, using CRUBIT_UNSAFE.CRUBIT_MUST_BIND.CRUBIT_RUST_NAME("rust_name_here").pub(crate) visibility in Rust, limiting its visibility to the generated crate (including custom srcs on rust_api_from_cpp), using CRUBIT_PUB_CRATE.More information:
//support:annotations#include "support/annotations.h"Given the following C++ header:
{{ #include ../../examples/cpp/unsafe_attributes/example.h }}
Crubit will generate the following bindings:
{{ #include ../../examples/cpp/unsafe_attributes/example_generated.rs }}