Crate stash

Source
Expand description

Stash is a library for efficiently storing maps of keys to values when one doesn’t care what the keys are but wants blazing fast O(1) insertions, deletions, and lookups.

Common use cases include file descriptor tables, session tables, or MIO context tables.

Blazing means an order of magnitude faster than hash maps and btree maps.

§Serialization

A stash can be serialized and deserialized with serde, preserving its existing key/value mapping. This can be used to save/restore a stash to persistant storage.

However, in general, stashes make no guarantees on how keys are assigned. If stash A is serialized then deserialized into stash B, values inserted into stash A will likely be assigned different keys than values inserted into stash B.

Modules§

index
stash
unique_stash

Structs§

Stash
An O(1) amortized table that reuses keys.
Tag
A versioned index into a UniqueStash.
UniqueStash
An O(1) amortized table that does not reuse keys.

Traits§

Index
Every index type to be used with Stash needs to implement this trait