Skip to main content

Module pagedb_backing

Module pagedb_backing 

Source
Expand description

PagedbBacking: low-allocation VectorSegmentBacking backed by a decrypted pagedb segment loaded into a heap-pinned byte buffer.

The segment stores raw NDVS v2 bytes (header + vectors + padding + surrogates + footer) spread across 4 KiB encrypted pagedb data pages. On open, all pages are decrypted and concatenated into a single Box<[u8]>. Subsequent get_vector / get_surrogate calls are pure pointer arithmetic into that buffer — no I/O, no allocation per lookup.

§Format identity

The byte layout inside the buffer is bit-identical to the NDVS v2 format used by nodedb_vector::mmap_segment. A segment written by PagedbBacking can be opened by MmapVectorSegment::open on Origin (and vice-versa), which is the cross-deployment compatibility contract.

§Compile scope

This module is only compiled on non-WASM targets. WASM uses the legacy blob checkpoint path.

Structs§

PagedbBacking
VectorSegmentBacking backed by a decrypted pagedb segment.