Skip to content
API REFERENCEUsage guides →

cellpack::format::cpk::Superblock ​

struct

Module contract · All interfaces

At a glance ​

pub struct Superblock {
    pub page_size: u32,
    pub dtype: Dtype,
    pub source: SourceLayout,
    pub n_rows: u64,
    pub n_cols: u32,
    pub n_chunks: u32,
    pub chunk_rows: u32,
    pub directory_offset: u64,
    pub file_len: u64,
}

Decoded superblock fields.

Fields and variants ​

page_size ​

page_size: u32

Page size records were packed to, in bytes; a power of two in [512, 65536], which also aligns every chunk offset.

dtype ​

dtype: Dtype

Numeric type of the stored values.

source ​

source: SourceLayout

Layout the matrix arrived in; records choose their own layout.

n_rows ​

n_rows: u64

Rows of the whole matrix; the chunks’ row counts add up to it.

n_cols ​

n_cols: u32

Columns of the whole matrix, i.e. the dims of every chunk.

n_chunks ​

n_chunks: u32

Directory entries, one per chunk.

chunk_rows ​

chunk_rows: u32

Rows per chunk the writer aimed for; early-ended and pre-packed chunks can have other row counts.

directory_offset ​

directory_offset: u64

Byte offset of the directory from the start of the file.

file_len ​

file_len: u64

End of the directory, which ends the file.

Member index ​

1 of 1 members

  • directory_lenBytes of the directory this superblock describes: n_chunks entries of ENTRY_LEN bytes each.

Methods and associated constants ​

directory_len ​

pub fn directory_len(&self) -> usize

Bytes of the directory this superblock describes: n_chunks entries of ENTRY_LEN bytes each.

Implemented traits ​

impl Clone for Superblock
impl Debug for Superblock

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