Expand description
Catalog (L5) — on-disk registry of collections.
See docs/format.md § Catalog for the authoritative on-disk
shape. The catalog is a B+tree (M4 data structure) keyed by
collection name and valued by postcard-encoded
CollectionDescriptors. Its root page-id is recorded in the
file header field root_catalog; the M2..M4 default of zero
signals “no catalog yet” and Catalog::open_or_init creates
one on first open.
§Power-of-ten posture
- Rule 1. Catalog walks go through the M4 B+tree API which uses an explicit stack — no recursion in this module.
- Rule 2.
Catalog::list_collectionsis bounded byMAX_COLLECTIONS; exceeding the bound surfaces asError::BTreeScanLimitExceeded. - Rule 5. Reserved-row presence is debug-asserted; the
try_intochain inid_from_bytesis the runtime boundary. - Rule 7. Every fallible step propagates via
?; nounwrapon the production path. - Rule 9. No
dyn— the catalog is generic overF: FileBackendand the B+tree it owns is monomorphised.
Structs§
- Catalog
- The catalog handle.
- Collection
Descriptor - On-disk description of a collection.
- Index
Descriptor - On-disk descriptor for a secondary index attached to a collection.
Enums§
- Index
Status - Lifecycle state of an
IndexDescriptor.
Constants§
- MAX_
COLLECTIONS - Maximum number of collections a single catalog may carry. Bounds
Catalog::list_collections(Rule 2) and the next-collection-id allocator below. 1 << 20 (1 048 576) is a generous ceiling — at 64-byte descriptor payloads the catalog would still fit in ~64 MiB.