vortex_layout/scan/row_mask.rs
1use std::ops::Range;
2
3use vortex_mask::Mask;
4
5/// A RowMask captures a set of selected rows within a row range.
6///
7/// The range itself can be [`u64`], but the length of the range must fit into a [`usize`], this
8/// allows us to use a `usize` filter mask within a much larger file.
9#[derive(Debug, Clone)]
10pub(crate) struct RowMask {
11 row_offset: u64,
12 mask: Mask,
13}
14
15impl RowMask {
16 pub fn new(row_offset: u64, mask: Mask) -> Self {
17 Self { row_offset, mask }
18 }
19
20 /// The row range of the [`RowMask`].
21 pub fn row_range(&self) -> Range<u64> {
22 self.row_offset..self.row_offset + self.mask.len() as u64
23 }
24
25 /// The mask of the [`RowMask`].
26 pub fn mask(&self) -> &Mask {
27 &self.mask
28 }
29}