Rust has a supreme system for control visibility and privacy. However, I can't find a way to apply the visibility modifier to declarative macro (the macro defined using macro_rules!
).
What I want is:
Macro m!
is defined in pub
module a
, and I want the visibility of m!
is equivalent to pub(crate)
.
The only related is #[macro_export]
and #[macro_use]
, but if I use #[macro_export]
to the m!
, this macro use public outside the crate.