id_cache
Download: crates.io/crates/id_cache
Docs: docs.rs/id_cache
This is a small crate built on id_collections
which provides a simple "cache" data structure for generating sequentially-assigned ids for unique values of some hashable type.
Example
use id_type;
use IdCache;
;
let mut word_cache: = new;
let foo_id = word_cache.make_id;
let bar_id = word_cache.make_id;
assert_eq!;
assert_eq!;
// ids for repeated values are reused:
assert_eq!;
Optional Features
This crate has optional Serde support, which can be enabled with the serde
Cargo feature.