vortex_pco/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright the Vortex contributors
3
4mod array;
5mod compute;
6#[cfg(test)]
7mod test;
8
9pub use array::*;
10
11#[derive(Clone, prost::Message)]
12pub struct PcoPageInfo {
13    // Since pco limits to 2^24 values per chunk, u32 is sufficient for the
14    // count of values.
15    #[prost(uint32, tag = "1")]
16    pub n_values: u32,
17}
18
19// We're calling this Info instead of Metadata because ChunkMeta refers to a specific
20// component of a Pco file.
21#[derive(Clone, prost::Message)]
22pub struct PcoChunkInfo {
23    #[prost(message, repeated, tag = "1")]
24    pub pages: Vec<PcoPageInfo>,
25}
26
27#[derive(Clone, prost::Message)]
28pub struct PcoMetadata {
29    // would be nice to reuse one header per vortex file, but it's really only 1 byte, so
30    // no issue duplicating it here per PcoArray
31    #[prost(bytes, tag = "1")]
32    pub header: Vec<u8>,
33    #[prost(message, repeated, tag = "2")]
34    pub chunks: Vec<PcoChunkInfo>,
35}