No, macros can see only the tokens you give them. They have no notion of the fact that crate::functions
is a module, that PluginFunction
is a trait and that functions_map
is a variable. Not even the compiler may know those informations when the macro is expanded.
If you really really want to do this, you can use something like inventory
. Note that inventory
uses a special linker section to do this, which some consider a hack. This is also not supported on WASM if you want to target it.
Most of those companies actually contribute to the kernel or to foundational software used on servers, but few contribute to the userspace for desktop consumers on the level that Valve does.