If you are writing a Rust library and want to call it C, you must flag all export functions with extern C and make sure everyone uses C ABI. But then you also need to write the header file manually to include it in your C code, and manually verify that it matches the definition of Rust, or Bad Things. It seems dangerous and tiring.
Is there a tool to generate C headers from Rust code? I have seen bindings that go the other way for using C from Rust, and this is actually the hardest problem!
source share