| 349 | } |
| 350 | |
| 351 | pub fn build_meta(t: &Tables, arena_len: u32, errors_json: StrRef, duration_ms: f64) -> Vec<u8> { |
| 352 | let mut m = Vec::with_capacity(META_SIZE); |
| 353 | m.push(KERNEL_ABI_VERSION); |
| 354 | m.extend_from_slice(&[0u8; 3]); |
| 355 | m.extend_from_slice(&t.node_count.to_le_bytes()); |
| 356 | m.extend_from_slice(&t.edge_count.to_le_bytes()); |
| 357 | m.extend_from_slice(&t.ref_count.to_le_bytes()); |
| 358 | m.extend_from_slice(&arena_len.to_le_bytes()); |
| 359 | m.extend_from_slice(&errors_json.0.to_le_bytes()); |
| 360 | m.extend_from_slice(&errors_json.1.to_le_bytes()); |
| 361 | m.extend_from_slice(&duration_ms.to_le_bytes()); |
| 362 | debug_assert_eq!(m.len(), META_SIZE); |
| 363 | m |
| 364 | } |
| 365 | |
| 366 | #[cfg(test)] |
| 367 | mod tests { |