Appearance
cellpack::format::Meta
Module contract · All interfaces
At a glance
pub struct Meta<'a> { /* private fields */ }Interpretation of a chunk’s metadata bytes. Holds no data of its own: header fields are decoded once, sections are borrowed.
Member index
21 of 21 members
n_cellsCells (rows) in the chunk.n_dimsDims (columns) of the chunk: its coded alphabet size.value_widthBytes per stored value (1, 2, 4 or 8), also the record value stride.index_widthByte width of raw record indices.renumberedWhether coded ids are a permutation of the source ids ( source_dim maps them back); without renumbering they are the source ids.column_modesThe column-mode table, value_width bytes per dim in coded order, when the chunk has one (see mode-coded records).max_nnzMost nnz any record in the chunk declares: stored entries for a sparse record (explicit zeros included), non-zeros for a dense one.max_elemsMost elements any record stores ( n_dims when a record is dense).max_kLargest per-cell dictionary in the chunk.nnz_totalThe chunk’s declared nnz: stored entries summed over sparse records, non-zeros over dense ones.meta_lenBytes of metadata.records_startWhere the records region starts in a chunk (page-aligned when paged).page_sizeThe page size records are packed to, if any.records_lenBytes of the records region: from Meta::records_start through the last record, gaps between records included.records_ofThe records region of a chunk whose metadata this is.chunk_lenBytes of the whole chunk.cell_nnzDeclared nnz of a cell (stored entries for sparse, non-zeros for dense), as the difference of two entries of the cumulative table, checked to be non-decreasing up to nnz_total and within max_nnz .cell_layoutLayout of a cell’s record from the metadata alone (an empty cell is sparse).cell_kindA cell’s record flags byte (0 for an empty cell): its layout and index and value codings, for callers that model per-record costs.record_rangeByte range of a cell’s record within the records region, relative to Meta::records_start ; an empty cell gives an empty range.recordA cell’s record within the records region, i.e. records[record_range] for a region that holds the whole chunk’s records.
Methods and associated constants
n_cells
Cells (rows) in the chunk.
n_dims
Dims (columns) of the chunk: its coded alphabet size.
value_width
pub fn value_width(&self) -> usizeBytes per stored value (1, 2, 4 or 8), also the record value stride.
index_width
pub fn index_width(&self) -> usizeByte width of raw record indices.
renumbered
pub fn renumbered(&self) -> boolWhether coded ids are a permutation of the source ids (source_dim maps them back); without renumbering they are the source ids.
column_modes
pub fn column_modes(&self) -> Option<&'a [u8]>The column-mode table, value_width bytes per dim in coded order, when the chunk has one (see mode-coded records).
max_nnz
Most nnz any record in the chunk declares: stored entries for a sparse record (explicit zeros included), non-zeros for a dense one.
max_elems
Most elements any record stores (n_dims when a record is dense).
max_k
Largest per-cell dictionary in the chunk.
nnz_total
The chunk’s declared nnz: stored entries summed over sparse records, non-zeros over dense ones.
meta_len
Bytes of metadata.
records_start
pub fn records_start(&self) -> usizeWhere the records region starts in a chunk (page-aligned when paged).
page_size
The page size records are packed to, if any.
records_len
pub fn records_len(&self) -> u64Bytes of the records region: from Meta::records_start through the last record, gaps between records included.
records_of
pub fn records_of<'c>(&self, chunk: &'c [u8]) -> Result<&'c [u8]>The records region of a chunk whose metadata this is.
chunk_len
Bytes of the whole chunk.
cell_nnz
Declared nnz of a cell (stored entries for sparse, non-zeros for dense), as the difference of two entries of the cumulative table, checked to be non-decreasing up to nnz_total and within max_nnz.
cell_layout
pub fn cell_layout(&self, cell: usize) -> Result<RecordLayout>Layout of a cell’s record from the metadata alone (an empty cell is sparse).
cell_kind
A cell’s record flags byte (0 for an empty cell): its layout and index and value codings, for callers that model per-record costs.
record_range
pub fn record_range(&self, cell: usize) -> Result<Range<usize>>Byte range of a cell’s record within the records region, relative to Meta::records_start; an empty cell gives an empty range.
record
A cell’s record within the records region, i.e. records[record_range] for a region that holds the whole chunk’s records.
Implemented traits
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.