By any chance, is there 'prior art' on converting C/C++ type definitions into Rust native data structures?
I know there's cxx and bindgen for calling into C/C++, from Rust, but anything that converts the definitions to native Rust?
Besides providing unsafe extern "C" function declarations, the bindgen crate will define ABI-compatible Rust types for your C/C++ types.
Rust has enough control over how types are laid out in memory that there is no "conversion" logic required for interoperating with C or (most basic) C++ - you can just do a pointer cast.
Thanks, there's no interop required at all. Just looking to convert headers to Rust data types.
So, changing from unions in .h to Rust enums, for example...