vortex_array/arrays/bool/
mod.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright the Vortex contributors
3
4mod array;
5pub mod compute;
6mod ops;
7mod patch;
8mod serde;
9#[cfg(feature = "test-harness")]
10mod test;
11
12pub use array::*;
13// Re-export the BooleanBuffer type on our API surface.
14pub use arrow_buffer::{BooleanBuffer, BooleanBufferBuilder};
15
16use crate::vtable::{NotSupported, VTable, ValidityVTableFromValidityHelper};
17use crate::{EncodingId, EncodingRef, vtable};
18
19vtable!(Bool);
20
21impl VTable for BoolVTable {
22    type Array = BoolArray;
23    type Encoding = BoolEncoding;
24
25    type ArrayVTable = Self;
26    type CanonicalVTable = Self;
27    type OperationsVTable = Self;
28    type ValidityVTable = ValidityVTableFromValidityHelper;
29    type VisitorVTable = Self;
30    type ComputeVTable = NotSupported;
31    type EncodeVTable = NotSupported;
32    // Enable serde for this encoding
33    type SerdeVTable = Self;
34
35    fn id(_encoding: &Self::Encoding) -> EncodingId {
36        EncodingId::new_ref("vortex.bool")
37    }
38
39    fn encoding(_array: &Self::Array) -> EncodingRef {
40        EncodingRef::new_ref(BoolEncoding.as_ref())
41    }
42}
43
44#[derive(Clone, Debug)]
45pub struct BoolEncoding;