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.1
- Added trait
GeneratorFromSeed
and implementation forSequenceGenerator
. - Added benchmark to compare the two current implementations.
Version 0.1.0
- Simple traits
Generator
,GeneratorWithInvalid
, andGeneratorFromStr
. StringGenerator
using UUIDsSequenceGenerator
usingi64
TODO
- Decide on better
FromStr
support.