feat(parser): add hierarchy scans and selective cell reads

Reuse library builders and cell traversal for full reads, lightweight hierarchy scans, and exact cell byte ranges. Preserve file offsets across readers and reject malformed ranges and FFI pointer/count inputs without aborting.

Document scan schemas and ID assignment. Add regression coverage for Arrow round trips, transforms, subset ordering, empty selections, and invalid input.
This commit is contained in:
Jan Petykiewicz 2026-11-14 14:27:09 -08:00
commit 9643089f2d

View file

@ -27,7 +27,10 @@ impl RecordHeader {
pub fn read(input: &[u8]) -> IResult<'_, RecordHeader> {
let (input, size) = parse_u16(input)?;
let (input, tag) = parse_u16(input)?;
Ok((input, RecordHeader{tag, data_size:size - 4}))
let Some(data_size) = size.checked_sub(4) else {
return fail(input, format!("Record size {size} is smaller than its header"));
};
Ok((input, RecordHeader{tag, data_size}))
}
pub fn pack_into(&self) -> [u8; 4] {