pack_record

Function pack_record 

Source
pub fn pack_record(
    spec: &ExpertRecordSpec,
    stride: u64,
    header: &ExpertRecordHeader,
    projs: &[ProjData<'_>; 3],
) -> Result<Vec<u8>>
Expand description

Assemble one complete stride-byte record: header at offset 0, each projection’s packed+scale bytes placed at the spec’s sub-offsets, zero padding everywhere else. Returns exactly stride bytes.

Errors (never panics) if any projection’s byte lengths disagree with the spec, or if the assembled payload would not fit in stride — those are builder bugs we want surfaced loudly, not silently truncated records.