Expand description

Halfbrown is a hashmap implementation that provides high performance for both small and large maps by dymaically switching between different backend.

The basic idea is that hash maps are expensive to insert and lookup for small numbers of entries but effective for larger numbers.

So for smaller maps, we picked 32 entries as a rule of thumb, we simply store data in a list of tuples. Looking those up and iterating over them is still faster then hasing strings on every lookup.

Once we pass the 32 entires we transition the backend to a HashMap.

Note: Most of the documentation is taken from rusts hashmap.rs and should be considered under their copyright.

Macros

Create a HashMap from a list of key-value pairs

Structs

Drains the map

HashMap implementation that alternates between a vector and a hashmap to improve performance for low key counts.

Into iterator for a Halfbrown map

Iterator over the key value pairs of a Halfbrown map

Mutable iterator over the key value pairs

Iterator over the keys

A view into an occupied entry in a HashMap. It is part of the Entry enum.

A builder for computing where in a [HashMap] a key-value pair would be stored.

A builder for computing where in a [HashMap] a key-value pair would be stored.

A view into an occupied entry in a HashMap. It is part of the RawEntryMut enum.

A view into a vacant entry in a HashMap. It is part of the RawEntryMut enum.

A view into a vacant entry in a HashMap. It is part of the Entry enum.

Iterator over the values

Mutable iterator over the values

Enums

A view into a single entry in a map, which may either be vacant or occupied.

A view into a single entry in a map, which may either be vacant or occupied.

Constants

Maximum nymber of elements before the representaiton is swapped from Vec to HashMap

Type Definitions

Default hasher for HashMap.