Appearance
cellpack::loader::CsrRow
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
context: ProcessContextABI version, struct size, position, cell, schema and user data.
out_dim
out_dim: u64Output dims of the schema: the upper bound of a column.
nnz
nnz: u64Stored elements listed; every other output dim is 0 or missing.
columns
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
Maps elements of row on demand; null unless rows are partial.
out
The cell’s output: exactly the schema’s cell_bytes.
scratch
This call’s private scratch, at least the schema’s scratch_bytes long.
scratch_bytes
scratch_bytes: u64Bytes 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.