| Crates.io | thicket |
| lib.rs | thicket |
| version | 0.1.1 |
| created_at | 2025-06-26 08:57:25.159096+00 |
| updated_at | 2025-06-27 08:38:26.174282+00 |
| description | Collections using splay trees |
| homepage | |
| repository | https://github.com/duncanlivingston/thicket |
| max_upload_size | |
| id | 1727053 |
| size | 122,829 |
This crate implements a variety of collections based on binary trees, in particular splay trees. Splay trees are a type of data structure that offers logarithmic time lookup for random access of data. They are self-organising, in the sense that commonly accessed items with the tree send to 'bubble' to the top so that future lookups of these items will be faster in the future.
The crate complements the standard std::collection routines, but provide the following
benefits:
Cloneor Copy. Keys the support Ord can
use Map or Set, etc, but if not a custom function can be supplied to compare keys using
MapBy or StringMapBy, etc.#![no_std].pop_first() returns a reference &(K, V) not
a value (K, V).The initial release of the thicket crate includes the following types
| Type | Stores | Sorts By | Iterator |
|---|---|---|---|
Map |
Key/Value | Ord | MapIterator |
Set |
Key | Ord | SetIterator |
StringMap |
String/Value | Ord | StringMapIterator |
StringSet |
String | Ord | StringSetIterator |
MapBy |
Key/Value | Function | MapByIterator |
SetBy |
Key | Function | SetByIterator |
StringMapBy |
String/Value | Function | StringMapByIterator |
StringSetBy |
String | Function | StringSetByIterator |
The crate exposes an additional type util::Tree that provides the foundation of the other
types. This can be thought of as a utility that manages a set of usize indices into an
external vector of data, without storing the vector itself. It is provided to support
development of additional collection types.