formualizer_eval/
stripes.rs1pub struct NumericChunk<'a> {
5 pub data: &'a [f64],
6 pub validity: Option<ValidityMask<'a>>, }
8
9pub enum ValidityMask<'a> {
11 Bits(&'a [u64]),
12 Bools(&'a [bool]),
13}
14
15pub enum CellChunk<'a> {
17 Mixed(&'a [formualizer_common::LiteralValue]),
19 Numbers(&'a [f64]),
21}
22
23impl<'a> NumericChunk<'a> {
24 pub fn len(&self) -> usize {
25 self.data.len()
26 }
27 pub fn is_empty(&self) -> bool {
28 self.data.is_empty()
29 }
30}
31
32#[cfg(test)]
33mod tests {
34 use super::*;
35
36 #[test]
37 fn basic_numeric_chunk_properties() {
38 let buf = [1.0, 2.0, 3.0];
39 let ch = NumericChunk {
40 data: &buf,
41 validity: None,
42 };
43 assert_eq!(ch.len(), 3);
44 assert!(!ch.is_empty());
45 }
46}