Crate btree_experiment

Source
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 of BTreeMap via serde crate.
  • unsafe-optim : uses unsafe code for extra optimisation.

Structs§

BTreeMap
BTreeMap similar to std::collections::BTreeMap.
Cursor
Cursor returned by BTreeMap::lower_bound, BTreeMap::upper_bound.
CursorMut
Cursor that allows mutation of map, returned by BTreeMap::lower_bound_mut, BTreeMap::upper_bound_mut.
CursorMutKey
Cursor that allows mutation of map keys, returned by CursorMut::with_mutable_key.
DefaultAllocTuning
Default implementation of AllocTuning. Default branch is 64, default allocation unit is 8.
ExtractIf
Iterator returned by BTreeMap::extract_if.
IntoIter
Consuming iterator for BTreeMap.
IntoKeys
Consuming iterator returned by BTreeMap::into_keys.
IntoValues
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.
OccupiedEntry
Occupied Entry.
OccupiedError
Error returned by BTreeMap::try_insert.
Range
Iterator returned by BTreeMap::range.
RangeMut
Iterator returned by BTreeMap::range_mut.
UnorderedKeyError
Error type for CursorMut::insert_before and CursorMut::insert_after.
VacantEntry
Vacant Entry.
Values
Iterator returned by BTreeMap::values.
ValuesMut
Iterator returned by BTreeMap::values_mut.

Enums§

Entry
Entry in BTreeMap, returned by BTreeMap::entry.
FullAction
Type returned by AllocTuning::full_action.

Traits§

AllocTuning
Trait for controlling storage allocation for BTreeMap.