Skip to main content

Module catalog

Module catalog 

Source
Expand description

The collection catalogue, which is what makes a .yo file self describing.

07 section 5. One entry per named collection, chained from the superblock’s catalog_addr.

The entry stores the schema bytes in full and not just their hash. That costs space in a structure there is one of per collection, and it buys two things. A shape mismatch can print both shapes instead of two hex digests, which is the difference between an error a user can act on and an error a user files a bug about. And a tool that has never seen the writer’s source can still say what is in the file, which is the concrete form of the promise that the format is readable without us.

Structs§

CatalogEntry
One catalogue entry, decoded, borrowing its name and schema from the file.

Enums§

Band
How a collection is laid out, which is chosen by size and not by the caller.
Model
Which of the four models a collection belongs to.
ValueType
The Redis type of a key value collection.

Constants§

ENTRY_HEAD_LEN
The fixed part of an entry. Name and schema follow, then the checksum.
ENTRY_TRAILER_LEN
The checksum at the end.
MAX_NAME_LEN
The largest name, because name_len is a u16.

Functions§

entry_len
The bytes an entry with this name and schema needs.