Skip to content
API REFERENCEUsage guides →

cellpack::format::parse_meta ​

fn

Module contract · All interfaces

At a glance ​

pub fn parse_meta(bytes: &[u8]) -> Result<Meta<'_>>

Parses metadata from the start of bytes (the metadata alone or a whole chunk). Checks the header and section sizes; per-cell table entries are checked where they are read.

One pass of O(1) checks: magic, version, reserved bits, the dim count, value width and lane and page parameters, the per-dimension and per-cell maxima against each other, the model frequencies (each sums to 0 or to the rANS total, and no symbol above MAX_SYMBOL is used), the layout against meta_len, the chunk extent against the address space, and the non-zero table (first entry 0, last nnz_total). Record bytes are not read, so metadata alone can be validated before any record is touched.

The returned view also carries model_key, a hash of the coding inputs (n_dims, renumbering, models, dim sources, column modes) that lets the decode tables check they were built for this chunk.

Contract reference ​

See the module reference for semantic input/output rules, units, allocation, mutation, failure behavior, and lifetime requirements. Declarations and documented members are synchronized from the crate source.

Definition