Skip to main content

reifydb_column/
selection.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2025 ReifyDB
3
4use reifydb_core::value::column::mask::RowMask;
5
6#[derive(Clone, Debug)]
7pub enum Selection {
8	All,
9	None_,
10	Mask(RowMask),
11}
12
13impl Selection {
14	pub fn is_all(&self) -> bool {
15		matches!(self, Self::All)
16	}
17
18	pub fn is_none(&self) -> bool {
19		matches!(self, Self::None_)
20	}
21
22	pub fn as_mask(&self) -> Option<&RowMask> {
23		match self {
24			Self::Mask(m) => Some(m),
25			_ => None,
26		}
27	}
28}