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.0
- Simple traits
Generator,GeneratorWithInvalid, andGeneratorFromStr. StringGeneratorusing UUIDsSequenceGeneratorusingi64
TODO
- Allow for seeding
- Decide on FromStr support