label-macros

Crates.iolabel-macros
lib.rslabel-macros
version0.6.0
sourcesrc
created_at2020-06-26 13:32:27.445997
updated_at2020-06-29 12:31:20.155635
descriptionLabel functions and iterate over them.
homepagehttps://github.com/jonay2000/label
repositoryhttps://github.com/jonay2000/label
max_upload_size
id258387
size15,591
Jonathan Dönszelmann (jdonszelmann)

documentation

https://docs.rs/label

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


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

Contributing

Any contributions are welcome. Just make a pull request or issue and I will try to respond as soon as possible.

License

MIT

Commit count: 48

cargo fmt