Skip to main content

Module header

Module header 

Source
Expand description

Segment header — 32-byte fixed prefix at file offset 0.

Layout (little-endian):

┌────────┬─────────┬───────┬─────────────┬──────────┐
│ magic  │ version │ flags │ schema_hash │  crc32c  │
│ 8 byte │  2 byte │ 2 byte│   8 byte    │  4 byte  │
└────────┴─────────┴───────┴─────────────┴──────────┘

Total: 20 bytes covered by CRC + 4 byte CRC = 24 bytes.

schema_hash is a fingerprint of the crate::schema::ArraySchema the segment was written against; readers reject segments whose hash doesn’t match the live schema (no implicit migrations).

Structs§

SegmentHeader
Fixed-size segment header.

Constants§

FORMAT_VERSION
On-disk format version. Bump on layout-incompatible changes.
HEADER_MAGIC
b"NDAS\0\0\0\1" — NodeDB Array Segment, version slot in last byte.
HEADER_SIZE