::method_name
This crate is a fork of https://github.com/danielhenrymantilla/rust-function_name
Function attribute #[named] that generates a method_name! macro
in the scope of the function's body.
The generated method_name!() is a macro that expands to
the name of the annotated function, as a string literal.
Examples
use named;
For methods, put #[named] on the impl block to include the enclosing type
in method_name!():
use named;
;
When #[named] is placed directly on a method, method_name!() continues to
return only the method name.
Since the generated method_name! expands to a string literal,
it can be used with other macros such as concat!:
extern crate method_name;
Unstable API
The method_name_unstable!() macro is available when the unstable feature is
enabled. This API may change in future releases.
Enable the feature in your dependency declaration:
= { = "0.3", = ["unstable"] }
Then import and call the macro from your crate:
use method_name_unstable;