Skip to main content

Module bytes

Module bytes 

Source
Expand description

Generic byte-tree facade.

This file is the main reusable interface of the B-tree layer. It lets callers treat a tree as an ordered map from &[u8] to &[u8] while the implementation handles page layout, splitting, merging, cursor navigation, and large-value overflow.

Layer split:

caller
  provides: ordered key bytes, opaque value bytes
  sees:     insert / delete / get / cursor / range helpers / stats

byte tree
  owns:     root tracking, node mutation, structural validation, overflow-backed values

pager
  owns:     page IO, free-page reuse, checksums, journaling, WAL, locking

Large values are represented with a B-tree-owned wrapper:

logical value
     |
     v
StoredValueLayout
  local payload bytes
  total length
  first overflow page

That extra indirection is what keeps overflow handling generic instead of pushing it into the catalog or table code.

Structsยง

ByteTree
ByteTreeCursor
ByteTreeStore