Expand description
This crate implements a BTreeMap similar to std::collections::BTreeMap.
The standard BtreeMap can use up to twice as much memory as required, this BTreeMap only allocates what is needed ( or a little more to avoid allocating too often ), so memory use can be up to 50% less.
§Example
use btree_experiment::BTreeMap;
let mut mymap = BTreeMap::new();
mymap.insert("England", "London");
mymap.insert("France", "Paris");
println!("The capital of France is {}", mymap["France"]);§Features
This crate supports the following cargo features:
serde: enables serialisation ofBTreeMapvia serde crate.unsafe-optim: uses unsafe code for extra optimisation.
Structs§
- BTree
Map BTreeMapsimilar tostd::collections::BTreeMap.- Cursor
- Cursor returned by
BTreeMap::lower_bound,BTreeMap::upper_bound. - Cursor
Mut - Cursor that allows mutation of map, returned by
BTreeMap::lower_bound_mut,BTreeMap::upper_bound_mut. - Cursor
MutKey - Cursor that allows mutation of map keys, returned by
CursorMut::with_mutable_key. - Default
Alloc Tuning - Default implementation of AllocTuning. Default branch is 64, default allocation unit is 8.
- Extract
If - Iterator returned by
BTreeMap::extract_if. - Into
Iter - Consuming iterator for
BTreeMap. - Into
Keys - Consuming iterator returned by
BTreeMap::into_keys. - Into
Values - Consuming iterator returned by
BTreeMap::into_values. - Iter
- Iterator returned by
BTreeMap::iter. - IterMut
- Iterator returned by
BTreeMap::iter_mut. - Keys
- Iterator returned by
BTreeMap::keys. - Occupied
Entry - Occupied Entry.
- Occupied
Error - Error returned by
BTreeMap::try_insert. - Range
- Iterator returned by
BTreeMap::range. - Range
Mut - Iterator returned by
BTreeMap::range_mut. - Unordered
KeyError - Error type for
CursorMut::insert_beforeandCursorMut::insert_after. - Vacant
Entry - Vacant Entry.
- Values
- Iterator returned by
BTreeMap::values. - Values
Mut - Iterator returned by
BTreeMap::values_mut.
Enums§
- Entry
- Entry in
BTreeMap, returned byBTreeMap::entry. - Full
Action - Type returned by AllocTuning::full_action.
Traits§
- Alloc
Tuning - Trait for controlling storage allocation for BTreeMap.