pub fn decode_header(page: &Page) -> Result<FileHeader>Expand description
Decode the page-0 header from the given page buffer. Validates
magic, page-size, major version, the per-major format_minor
constraint, and the header_crc32c field.
Phase 8 (issue #17): readers accept any
SUPPORTED_FORMAT_MAJORS value (0 for pre-1.0 databases,
1 for v1.0+). The per-major format_minor constraint is:
format_major = 0→format_minor ∈ {0, 1, 2}(the pre-1.0 incremental rollout: baseline, compression-capable, encryption-capable).format_major = 1→format_minor = 2(the v1.0 frozen feature-complete value; the only valid minor inside the v1.x series).
§Errors
Error::InvalidFormatif the magic bytes do not match, ifformat_majoris unsupported by this build, ifformat_minoris not valid for the file’sformat_major, or ifpage_sizedisagrees withPAGE_SIZE.Error::Corruptionwithpage_id = 0if the storedheader_crc32cdoes not match the CRC32C of the rest of the page.