Expand description
Segment read/write helpers for the Lite array engine.
On pagedb-backed storage (as_array_segment_ext() returns Some), tile
data is stored in pagedb encrypted segments under arr/tile/{name}/{id}.
On WASM (where as_array_segment_ext() returns None), the legacy KV blob path is used:
bytes stored in the Array namespace under segment:{name}:{id}.
The on-disk bytes are identical in both paths — the exact output of
nodedb_array::SegmentWriter::finish(), which includes the header, tile
frames, and footer. SegmentReader::open can parse them directly.
Functions§
- collect_
tile_ versions_ across_ segments - Collect all live cells from all segments for the given
hilbert_prefixat or beforesystem_as_of— used byarray_slice. - delete_
segment - Delete the segment for
seg_idfrom storage. - iter_
cell_ versions_ across_ segments - Collect all tile versions for
hilbert_prefixat or beforesystem_as_ofacross all segments, filtering to cells atcoord. Returns raw cell bytes for each(TileId, cell_bytes)pair compatible with the ceiling resolver. - load_
segment - Load segment bytes for
seg_id. - open_
reader - Open a
SegmentReaderover the given byte slice. - rewrite_
segment - Compile a new merged segment from the provided
(TileId, SparseTile)list and persist it, then delete the old segments. - tile_
versions_ from_ bytes - Read all decoded cells matching
hilbert_prefixat or beforesystem_as_offrom a single segment’s bytes (already loaded). Returns(TileId, TilePayload). - write_
segment - Flush a batch of
(TileId, SparseTile)pairs into a new segment and persist the bytes.