Expand description
bbtree: the blessed B-tree.
Modules§
- bbtree_
map BBTreeMap, an ordered map that threads share, and the types that go with it.- unsync
- An ordered map and set for one thread at a time:
BBTreeMapandBBTreeSet, drop-in replacements for std’sBTreeMapandBTreeSet(D1). They use the same nodes ascrate::BBTreeMap, which threads share. They take&mut selfto change, lend references into their nodes, and latch nothing.
Structs§
- Alloc
Error - An allocator had no block to give.
- Annexed
Leaf - A leaf of a
BBTreeMapwith strategyS, that an insert or a removal holds exclusively for'a, while it runs its caller’s closure (BBTreeMap::update_or_insert_with_leaf,BBTreeMap::remove_with_leaf): the leaf’s annex (LeafAnnex), and its keys. No other thread reads or changes them meanwhile. - Auto
- The default strategy: std byte-string keys and 64- and 128-bit integer keys have inline keys, other keys have none, at no cost.
- BBTree
Map - An ordered map that threads share, through
&self: a B+-tree whose internal nodes are read optimistically, and whose leaves are latched (design/09-concurrency.md). - Configured
- The strategy whose inline keys are strategy
S’s, and whose nodes are built as configCsays:Configured<Auto, C>orConfigured<WithInlineKey, C>. - Global
- The global allocator, which
#[global_allocator]picks: what a map uses unless given another. - With
Inline Key - The opt-in strategy: every key has the inline key its
InlineKeyimpl gives, of which the nodes keepInlineKey::WIDTHbytes, and the hash tag it gives ifInlineKey::HAS_HASH_TAG. - With
Leaf Annex - The strategy whose inline keys and node config are strategy
S’s, and whose leaves keep an annexL: for aBBTreeMap.
Enums§
- Inline
Width - How many bytes of each inline key the nodes keep: the first 2, the first
4, or all 8 of the window that
InlineKey::inline_key_atgives.
Traits§
- Allocator
- An allocator of the pages a map keeps its nodes in, and that the code keeping a map’s keys and values beside it keeps them in (heap pages).
- Inline
Key - A key type whose keys have inline keys: windows of the key’s encoding, a byte string that orders like the key.
- Inline
KeyStrategy - Which keys of a map with keys
Khave inline keys:AutoorWithInlineKey, with the defaultNodeConfig, or either of them with another,Configured; and what its leaves keep besides,WithLeafAnnex. These are the only implementations. - Leaf
Annex - Data a
BBTreeMapkeeps in each of its leaves, right after the leaf’s header, for the code that owns where its keys and values point: it reads and changes it while an insert or a removal holds the leaf (AnnexedLeaf). The map keeps it with its leaf: - Node
Config - How a map builds its nodes: constants the map reads at compile time, so that a map with a config runs as one without would at the same sizes.
Type Aliases§
- Inline
Word - An inline key: bytes of a key’s encoding, big-endian, so that inline keys
compare like the bytes they come from (see
InlineKey).