I suppose if you were really concerned, you could use some proc-macro trickery to change the name of the secret function on each build. That should prevent any unscrupulous users from trying to use this undocumented and secret API... But it would also seem like a nice idea for the language to have a mechanism to do this for us.
droundy
5
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Hiding private implementation details for a proc macro | 1 | 113 | May 28, 2026 | |
| What to do for macro-only APIs? | 1 | 228 | May 14, 2024 | |
| Code reuse in procedural macro | 1 | 302 | November 15, 2023 | |
| Private fields in macro-generated structs | 9 | 511 | October 23, 2024 | |
| Lib.rs does not restrict the visibility scope for macro defined with macro_rules! | 10 | 423 | January 29, 2024 |