1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub struct PrimaryBounds {
6 minimum: i64,
7 maximum: i64,
8}
9
10impl PrimaryBounds {
11 pub(crate) fn new(minimum: i64, maximum: i64) -> Self {
12 Self { minimum, maximum }
13 }
14
15 pub fn min(&self) -> i64 {
17 self.minimum
18 }
19
20 pub fn max(&self) -> i64 {
22 self.maximum
23 }
24}
25
26#[derive(Debug, Clone, PartialEq, Eq)]
28pub struct BlockMetadata {
29 sequence: u64,
30 file_offset: u64,
31 total_length: u64,
32 row_count: u64,
33 base_row_id: Option<u64>,
34 primary_bounds: Option<PrimaryBounds>,
35 ts_sorted: bool,
36}
37
38impl BlockMetadata {
39 pub(crate) fn new(
40 sequence: u64,
41 file_offset: u64,
42 total_length: u64,
43 row_count: u64,
44 base_row_id: Option<u64>,
45 primary_bounds: Option<PrimaryBounds>,
46 ts_sorted: bool,
47 ) -> Self {
48 Self {
49 sequence,
50 file_offset,
51 total_length,
52 row_count,
53 base_row_id,
54 primary_bounds,
55 ts_sorted,
56 }
57 }
58
59 pub fn sequence(&self) -> u64 {
61 self.sequence
62 }
63
64 pub fn file_offset(&self) -> u64 {
66 self.file_offset
67 }
68
69 pub fn total_length(&self) -> u64 {
71 self.total_length
72 }
73
74 pub fn row_count(&self) -> u64 {
76 self.row_count
77 }
78
79 pub fn base_row_id(&self) -> Option<u64> {
81 self.base_row_id
82 }
83
84 pub fn primary_bounds(&self) -> Option<PrimaryBounds> {
86 self.primary_bounds
87 }
88
89 pub fn ts_sorted(&self) -> bool {
95 self.ts_sorted
96 }
97}