3 ms·
Procedural macros aren't the macro_rules and custom derives that are currently in stable. They allow you to do much more. You can see this put to use in the Ro
by bluejekyll 9y ago
Procedural macros aren't the macro_rules and custom derives that are currently in stable.
They allow you to do much more. You can see this put to use in the Rocket project quite heavily. I believe it should be possible to link against bindgen as described and generate the bindings inline.
The caveat here is that it would be fairly opaque to the user as you wouldn't see the generated bindings in code. For situations like that I rely on 'cargo doc' to generate the documentation such that I can see the actual interface generated.
Rocket codegen for example:
https://github.com/SergioBenitez/Rocket/tree/master/codegen https://github.com/SergioBenitez/Rocket/tree/master/codegen