Skip to main content

vortex_pco/
lib.rs

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