qualifier_attr
Procedural macro attributes for adding "qualifiers" to various items.
At the moment, the crate supports only functions with the following "qualifiers":
pub,pub(crate), ... - visibility qualifiersasync- async qualifierunsafe- unsafe qualifierconst- const qualifierextern "ABI"- ABI qualifier
as well as structures with pub, pub(crate), etc visibility qualifiers.
Modules can't be supported due to hygiene issues.
Named fields within structs can't be supported because as far as the author understands, attribute macros can't be applied to them.
Examples
use fn_qualifiers;
// We can add a qualifier to a function
// with an attribute.
const CONST_RES: u32 = const_fn;
// It's not so impresive on its own
// but with cfg_attr it can be conditional.
Learn more about cfg_attr here.