Skip to content
API REFERENCEUsage guides →

cellpack::format::Meta ​

struct

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 ​

pub fn n_cells(&self) -> usize

Cells (rows) in the chunk.

n_dims ​

pub fn n_dims(&self) -> u32

Dims (columns) of the chunk: its coded alphabet size.

value_width ​

pub fn value_width(&self) -> usize

Bytes per stored value (1, 2, 4 or 8), also the record value stride.

index_width ​

pub fn index_width(&self) -> usize

Byte width of raw record indices.

renumbered ​

pub fn renumbered(&self) -> bool

Whether 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 ​

pub fn max_nnz(&self) -> usize

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 ​

pub fn max_elems(&self) -> usize

Most elements any record stores (n_dims when a record is dense).

max_k ​

pub fn max_k(&self) -> usize

Largest per-cell dictionary in the chunk.

nnz_total ​

pub fn nnz_total(&self) -> u64

The chunk’s declared nnz: stored entries summed over sparse records, non-zeros over dense ones.

meta_len ​

pub fn meta_len(&self) -> usize

Bytes of metadata.

records_start ​

pub fn records_start(&self) -> usize

Where the records region starts in a chunk (page-aligned when paged).

page_size ​

pub fn page_size(&self) -> Option<u32>

The page size records are packed to, if any.

records_len ​

pub fn records_len(&self) -> u64

Bytes 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 ​

pub fn chunk_len(&self) -> u64

Bytes of the whole chunk.

cell_nnz ​

pub fn cell_nnz(&self, cell: usize) -> Result<usize>

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 ​

pub fn cell_kind(&self, cell: usize) -> Result<u8>

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 ​

pub fn record<'r>(&self, records: &'r [u8], cell: usize) -> Result<&'r [u8]>

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 ​

impl<'a> Clone for Meta<'a>
impl<'a> Debug for Meta<'a>

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