I’ve been writing a FFI for my Rust code, and I’ve used cbindgen to generate my C/C++ compatible header file. All good so far.
Some of my FFI functions are pretty small and likely to be hot, and I’m curious to know if there’s a way to generate “inline C” code for these rather than compile to a linkable function. It would be cool if these short functions could be transpiled into C, and emitted as inline functions in the header file produced by cbindgen.
I’ve not come across anything like this yet. So I’m wondering if it’s possible, or if there’s another approach that I should be considering.