1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use vortex_error::VortexResult;
use vortex_scalar::Scalar;

use crate::array::{BoolArray, BoolEncoding};
use crate::compute::ScalarAtFn;
use crate::ArrayDType;

impl ScalarAtFn<BoolArray> for BoolEncoding {
    fn scalar_at(&self, array: &BoolArray, index: usize) -> VortexResult<Scalar> {
        Ok(Scalar::bool(
            array.boolean_buffer().value(index),
            array.dtype().nullability(),
        ))
    }
}