C++ bindings for Rust use declarations
Crubit supports use declarations for functions and types, mapping them to
equivalent using declarations in C++.
Limitations:
- The
usedeclaration must refer to a function or type. - The
usedeclaration must import exactly one entity per name. For example,pub use m::x;is supported ifxrefers to a function, or to a type, but not if it refers to both a function and a type.
Example
Given the following Rust crate:
pub use module::function;
pub use module::Type;
Crubit will generate the following bindings:
using Type CRUBIT_INTERNAL_RUST_TYPE(":: example_crate_golden :: Type") =
::example_crate::Type;
using __crubit_assert_type = ::example_crate::Type;
using ::example_crate::function;