Creating a Pool of Callbacks from Rust to C++ with Proc Macros
Pete LeVasseur
Rust @ Woven by Toyota ???? | Chair @ Rust Safety-Critical Consortium Coding Guidelines Subcommittee | Maintainer @ Eclipse uProtocol
Hey folks ??
When writing our Software Defined Vehicle framework Eclipse uProtocol we decided on using Rust for the uStreamer service, which bridges between different underlying protocols (e.g. ZettaScale Technology 's Zenoh and SOME/IP).
In order to interoperate between high compute devices and mechatronics devices (think e.g. brake controllers or IMUs) we needed to communicate over SOME/IP. We chose to write a Rust wrapper over top of Connected Vehicle Systems Alliance (COVESA) 's vsomeip.
I wrote a Rust procedural macro which generates the thousands of extern "C" fns necessary to register and recycle for use when registering message handlers with vsomeip. Had to dig in a bit to troubleshoot the compile time explosion that happened and resolve it.
Read on for more ??