#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct PrimaryBounds {
minimum: i64,
maximum: i64,
}
impl PrimaryBounds {
pub(crate) fn new(minimum: i64, maximum: i64) -> Self {
Self { minimum, maximum }
}
pub fn min(&self) -> i64 {
self.minimum
}
pub fn max(&self) -> i64 {
self.maximum
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct BlockMetadata {
sequence: u64,
file_offset: u64,
total_length: u64,
row_count: u64,
base_row_id: Option<u64>,
primary_bounds: Option<PrimaryBounds>,
ts_sorted: bool,
}
impl BlockMetadata {
pub(crate) fn new(
sequence: u64,
file_offset: u64,
total_length: u64,
row_count: u64,
base_row_id: Option<u64>,
primary_bounds: Option<PrimaryBounds>,
ts_sorted: bool,
) -> Self {
Self {
sequence,
file_offset,
total_length,
row_count,
base_row_id,
primary_bounds,
ts_sorted,
}
}
pub fn sequence(&self) -> u64 {
self.sequence
}
pub fn file_offset(&self) -> u64 {
self.file_offset
}
pub fn total_length(&self) -> u64 {
self.total_length
}
pub fn row_count(&self) -> u64 {
self.row_count
}
pub fn base_row_id(&self) -> Option<u64> {
self.base_row_id
}
pub fn primary_bounds(&self) -> Option<PrimaryBounds> {
self.primary_bounds
}
pub fn ts_sorted(&self) -> bool {
self.ts_sorted
}
}