Crate unique_id
A trait and implementations for unique ID generators.
This crate provides three simple traits, starting with Generator. This will return successive unique identifiers. Two
implementations of this trait are provided which provide unique string and integer values respectively.
Example
The following shows an example of the StringGenerator implementation.
use Generator;
use StringGenerator;
let gen = default;
let mut last = gen.next_id;
for _ in 1..100_000
Changes
Version 0.1.2
- Added new
RandomGeneratorimplementation. - Put each implementation into its own feature.
- Added
#[inline]to some functions.
Version 0.1.1
- Added trait
GeneratorFromSeedand implementation forSequenceGenerator. - Added benchmark to compare the two current implementations.
Version 0.1.0
- Simple traits
Generator,GeneratorWithInvalid, andGeneratorFromStr. StringGeneratorusing UUIDsSequenceGeneratorusingi64
TODO
- Decide on better
FromStrsupport.