public struct BTreeIndex<Key: Comparable, Value>
An index into a collection that uses a B-tree for storage.
BTree indices belong to a specific tree instance. Trying to use them with any other tree instance (including one holding the exact same elements, or one derived from a mutated version of the original instance) will cause a runtime error.
This index satisfies
Collection’s requirement for O(1) access, but
it is only suitable for read-only processing – most tree mutations will
invalidate all existing indexes.
BTreeCursorfor an efficient way to modify a batch of values in a B-tree.