| 54 | } |
| 55 | |
| 56 | pub fn decode_row_kinds(data: &[u8]) -> ArrayResult<Vec<u8>> { |
| 57 | if data.len() < 4 { |
| 58 | return Err(ArrayError::SegmentCorruption { |
| 59 | detail: "row_kinds: truncated count".into(), |
| 60 | }); |
| 61 | } |
| 62 | let count = u32::from_le_bytes( |
| 63 | data[0..4] |
| 64 | .try_into() |
| 65 | .expect("invariant: bounds-checked above (data.len() >= 4)"), |
| 66 | ) as usize; |
| 67 | if data.len() < 4 + count { |
| 68 | return Err(ArrayError::SegmentCorruption { |
| 69 | detail: "row_kinds: truncated body".into(), |
| 70 | }); |
| 71 | } |
| 72 | Ok(data[4..4 + count].to_vec()) |
| 73 | } |
| 74 | |
| 75 | // --------------------------------------------------------------------------- |
| 76 | // Timestamp columns: Vec<i64> via gorilla |