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.
The following shows an example of the StringGenerator
implementation.
```rust use uniqueid::Generator; use uniqueid::string::StringGenerator;
let gen = StringGenerator::default(); let mut last = gen.nextid(); for _ in 1..100000 { let next = gen.nextid(); assertne!(last, next); last = next; } ```
Version 0.1.2
RandomGenerator
implementation.#[inline]
to some functions.Version 0.1.1
GeneratorFromSeed
and implementation for SequenceGenerator
.Version 0.1.0
Generator
, GeneratorWithInvalid
, and GeneratorFromStr
.StringGenerator
using UUIDsSequenceGenerator
using i64
FromStr
support.