Skip to content
API REFERENCEUsage guides →

cellpack::loader::CsrRow ​

struct

Module contract · All interfaces

At a glance ​

#[repr(C)]pub struct CsrRow {
    pub context: ProcessContext,
    pub out_dim: u64,
    pub nnz: u64,
    pub columns: *const u32,
    pub values: *const c_void,
    pub row: *const c_void,
    pub resolve: Option<ResolveFn>,
    pub out: *mut u8,
    pub scratch: *mut u8,
    pub scratch_bytes: u64,
}

A CSR row: nnz stored elements with output columns in the chunk’s coded order (not sorted) and values of the schema’s dtype. Every other output dim is a zero or missing (see the module notes). A dense record delivered as a CSR row lists its non-zeros.

With partial rows (see ProcessFn::with_partial_rows) columns and values may be null: the function then maps the elements it needs with resolve(row, positions, count, columns, values), which writes the column and value of each requested element (its position must lie below nnz; repeats allowed), or of every element in row order when positions is null and count == nnz. It returns 0, or nonzero for invalid arguments, including a position at or beyond nnz. The columns and values buffers are trusted to hold count entries. Partial rows are offered only when every element of the row has an output column.

Fields and variants ​

context ​

ABI version, struct size, position, cell, schema and user data.

out_dim ​

out_dim: u64

Output dims of the schema: the upper bound of a column.

nnz ​

nnz: u64

Stored elements listed; every other output dim is 0 or missing.

columns ​

columns: *const u32

Output columns of the nnz elements, or null with partial rows.

values ​

The nnz values, of the schema’s dtype, or null with partial rows.

row ​

The loader’s decoded row, the argument resolve expects; null unless rows are partial.

resolve ​

resolve: Option<ResolveFn>

Maps elements of row on demand; null unless rows are partial.

out ​

out: *mut u8

The cell’s output: exactly the schema’s cell_bytes.

scratch ​

scratch: *mut u8

This call’s private scratch, at least the schema’s scratch_bytes long.

scratch_bytes ​

scratch_bytes: u64

Bytes available at scratch.

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