https://github.com/jdonszelmann/label
https://github.com/jdonszelmann/label
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jdonszelmann/label
- Owner: jdonszelmann
- License: mit
- Created: 2020-06-26T13:10:08.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-05T20:54:47.000Z (over 5 years ago)
- Last Synced: 2025-02-28T09:06:17.543Z (over 1 year ago)
- Language: Rust
- Size: 55.7 KB
- Stars: 16
- Watchers: 2
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Label



`label` is a library that can be used to create custom attributes for functions, through which you can list them and perform actions on them.
Label uses no global state during the compilation process, to avoid incremental compilation breaking it.
# Example
```rust
create_label!(fn test() -> ());
#[test::label]
fn my_fn() {
println!("Test!");
}
fn main() {
println!("calling all 'test' label");
// using iter you can go through all functions with this annotation.
for i in test::iter() {
i();
}
}
```
Label also supports labels on `static` and `const` variables, and iterating over the names of labeled items.
For more information about this, visit the [docs](https://docs.rs/label)
## Contributing
Any contributions are welcome. Just make a pull request or issue and I will try to respond as soon as possible.
### License
[MIT](./LICENSE)