Skip to content

DexterHill0/randsym

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!"
}

About

Generates unique identifiers for macros

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages