randsym

Crates.iorandsym
lib.rsrandsym
version0.1.1
sourcesrc
created_at2022-12-13 00:58:59.928586
updated_at2022-12-13 12:37:05.435751
descriptionGenerates unique identifiers for macros
homepage
repositoryhttps://github.com/DexterHill0/randsym
max_upload_size
id735375
size7,952
Dexter Hill (DexterHill0)

documentation

README

randsym

Creates unique identifiers for macros.

github crates.io docs.rs

randsym generates unique identifiers using UUID. The unique identifiers can be used to simply avoid conflicts between items that may otherwise have had the same identifier, as well as being bound to names allowing the same identifiers to be repeated.

The syntax is as follows:

  • /?/ - random identifier
  • /?@the_ident/ - random identifier bound to the name the_ident

Examples:

No binding

randsym::randsym! {
    fn /?/ () -> String {
        "I have a random name!".into()
    }
}

With binding

randsym::randsym! {
    fn /?@my_fn/ () -> String {
        "I have a random name!".into()
    }

    println!("{}", /?@my_fn/()); // "I have a random name!"
}
Commit count: 4

cargo fmt