Crate unique_id

A trait and implementations for unique ID generators.

MIT License Minimum Rust Version crates.io docs.rs travis.ci GitHub stars

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.

```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; } ```

Changes

Version 0.1.2

Version 0.1.1

Version 0.1.0

TODO

  1. Decide on better FromStr support.