Skip to content
API REFERENCEUsage guides →

cellpack::scans::encode_record ​

fn

Module contract · All interfaces

At a glance ​

pub fn encode_record<'a>(
    meta: &Meta<'_>,
    tables: &EncodeTables,
    row: impl Into<RowRef<'a>>,
    opt: &EncodeOptions,
    out: &mut [u8],
    ws: &mut [u64],
) -> Result<usize>

Chunk and record encoding, the reusable PreparedEncoder, and the output and workspace bounds of both. Encodes one row with a chunk’s metadata and tables into out (at least record_bound bytes). ws needs encode_workspace_words for the chunk’s Meta::max_elems. Returns the record length; a row without non-zeros has an empty record. The row takes the smaller of its sparse and dense layouts as opt.layout allows; a dense candidate needs max_elems == n_genes. Dictionaries beyond Meta::max_k are not used, so the record fits the chunk’s decode workspace.

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