Skip to main content

znippy_common/
meta.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Serialize, Deserialize)]
4pub struct ChunkMeta {
5    pub fdata_offset: u64,
6    pub file_index: u64,
7    pub chunk_seq: u32,
8    /// BLAKE3 of this chunk's UNCOMPRESSED bytes (per-slice integrity).
9    pub checksum: [u8; 32],
10    pub compressed: bool,
11    pub uncompressed_size: u64,
12    pub compressed_size: u64,
13}
14
15/// Blob position written to the .znippy file; paired with ChunkMeta for the Arrow index.
16#[derive(Debug, Clone)]
17pub struct BlobMeta {
18    pub chunk_meta: ChunkMeta,
19    pub blob_offset: u64,
20    pub blob_size: u64,
21}
22
23#[derive(Debug, Clone, Serialize, Deserialize)]
24pub struct WriterStats {
25    pub total_chunks: u64,
26    pub total_written_bytes: u64,
27    pub verified_files: usize,
28    pub corrupt_files: usize,
29    pub verified_bytes: u64,
30    pub corrupt_bytes: u64,
31}
32
33#[derive(Debug)]
34pub struct ReaderStats {
35    pub total_files: usize,
36    pub skipped_files: usize,
37}
38
39#[derive(Debug)]
40pub struct FileMeta {
41    pub relative_path: String,
42    pub compressed: bool,
43    pub uncompressed_size: u64,
44    pub chunks: Vec<ChunkMeta>,
45}