✨ fn_type_alias
A proc attribute macro that generates a type alias with the given identifier for the attributed function.
Example
extern crate fn_type_alias;
// The type alias will inherit its visibility from the function
pub
// The type alias will be pub(crate), but the function will be pub
Use Case
This macro is well suited for conditional compilation. For example, using the fn_abi macro:
extern crate fn_type_alias;
extern crate fn_abi;
pub extern
// Expands to when building for Windows 64-bit:
pub type HelloWorldFn = extern "stdcall" fn;
pub extern "stdcall"