Skip to main content

vortex_zstd/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright the Vortex contributors
3
4pub use array::*;
5#[cfg(feature = "unstable_encodings")]
6pub use zstd_buffers::*;
7
8mod array;
9mod compute;
10mod rules;
11mod slice;
12#[cfg(feature = "unstable_encodings")]
13mod zstd_buffers;
14
15#[cfg(test)]
16mod test;
17
18#[derive(Clone, prost::Message)]
19pub struct ZstdFrameMetadata {
20    #[prost(uint64, tag = "1")]
21    pub uncompressed_size: u64,
22    #[prost(uint64, tag = "2")]
23    pub n_values: u64,
24}
25
26#[derive(Clone, prost::Message)]
27pub struct ZstdMetadata {
28    // optional, will be 0 if there's no dictionary
29    #[prost(uint32, tag = "1")]
30    pub dictionary_size: u32,
31    #[prost(message, repeated, tag = "2")]
32    pub frames: Vec<ZstdFrameMetadata>,
33}
34
35#[derive(Clone, prost::Message)]
36pub struct ZstdBuffersMetadata {
37    #[prost(string, tag = "1")]
38    pub inner_encoding_id: String,
39    #[prost(bytes = "vec", tag = "2")]
40    pub inner_metadata: Vec<u8>,
41    #[prost(uint64, repeated, tag = "3")]
42    pub uncompressed_sizes: Vec<u64>,
43    /// Alignment of each buffer in bytes (must be a power of two).
44    #[prost(uint32, repeated, tag = "4")]
45    pub buffer_alignments: Vec<u32>,
46}