Warning
This post was published 49 days ago. The information described in this article may have changed.
In rust I use macros to implement the same code for many types. I would like to document all the implementations in one place and have one example for them. What is the proper way to do this ?
Currently I put the documentation above the macro. (It is good to keep documentation source close to its implementation). But this is really the place for documenting how to use a macro instead of how to use the code it generates.
In addition, in the documentation generated by the macro, I would like to include links to the corresponding documentation (which lives above the macro). If the macro is private (while the function generated by the macro is pubic) the links fail. So I end up making macros public that I do not want to be public.
2 posts - 2 participants
🏷️ rust_feed