Appearance
cellpack::scans::PreparedEncoder
Module contract · All interfaces
At a glance
pub struct PreparedEncoder<'a> { /* private fields */ }Chunk and record encoding, the reusable PreparedEncoder, and the output and workspace bounds of both. A fixed, immutably borrowed input and its reusable statistical model. Construction performs model building and sizing; repeated writes preserve the same encoding decisions as encode_chunk.
Member index
6 of 6 members
newScans and prepares the selection once, fixing the gene order, column modes and models; fails on an invalid input or option.metadataModel metadata before record placement; use it for independent record encoding.metadata_bytesMetadata bytes of the chunk before any record is written; records appended with their extents and kinds complete the chunk.tablesThe tables matching Self::metadata , for encode_record .sizesOutput and workspace sizes of one Self::encode_into call.encode_intoWrites the chunk (metadata, then records, then the record extents and kinds in the header) into out , which must hold ChunkSizes::output_bytes bytes, using workspace of encode_workspace_words words. Returns the chunk length; repeated calls write the same bytes.
Methods and associated constants
new
pub fn new(
source: impl Into<MatrixRef<'a>>,
rows: Rows<'a>,
options: EncodeOptions,
) -> Result<Self>Scans and prepares the selection once, fixing the gene order, column modes and models; fails on an invalid input or option.
metadata
Model metadata before record placement; use it for independent record encoding.
metadata_bytes
pub fn metadata_bytes(&self) -> &[u8] ⓘMetadata bytes of the chunk before any record is written; records appended with their extents and kinds complete the chunk.
tables
pub fn tables(&self) -> &EncodeTablesThe tables matching Self::metadata, for encode_record.
sizes
pub fn sizes(&self) -> ChunkSizesOutput and workspace sizes of one Self::encode_into call.
encode_into
pub fn encode_into(
&self,
out: &mut [u8],
workspace: &mut [u64],
) -> Result<usize>Writes the chunk (metadata, then records, then the record extents and kinds in the header) into out, which must hold ChunkSizes::output_bytes bytes, using workspace of encode_workspace_words words. Returns the chunk length; repeated calls write the same bytes.
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.