| Crates.io | utally |
| lib.rs | utally |
| version | 1.0.1 |
| created_at | 2025-04-18 13:22:02.594892+00 |
| updated_at | 2025-04-18 13:25:27.173697+00 |
| description | Unique ids in static contexts |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1639447 |
| size | 17,643 |
This tool was created to allow easily creating unique ids for types in both static and dynamic contexts. The ids are sequential, this is basically a tally counter.
Call [next] to acquire a new unique id.
let unique_id = utally::next();
You can use [LazyTally] in order to assign ids to types or functions by using them in static contexts:
# use utally::*;
pub fn function_with_unique_id() -> usize {
static SOME_TALLY: LazyTally = LazyTally::new();
SOME_TALLY.get()
}
A call to function_with_unique_id would always return the same unique id.