Skip to main content

Module boolean

Module boolean 

Source
Expand description

§BooleanArray Module - Mid-Level, Inner Typed Boolean Array

BooleanArray is an Arrow-compatible, bit-packed boolean array implementation with optional null-mask support, 64-byte alignment, and efficient memory layout for analytical workloads.

§Overview

  • Logical type: boolean values (true / false) with optional null state.
  • Physical storage: bit-packed Bitmask for values, optional Bitmask for validity.
  • Backed by Vec64<u8>-aligned buffers for CPU-friendly operations.
  • Integrates with Arrow FFI and MaskedArray trait for schema-agnostic use.

§Features

  • Construction from raw bitmasks, byte buffers, or boolean slices.
  • Mutation: bulk bit writes, per-element set, push, null insertion.
  • Iteration: sequential and parallel (with parallel_proc feature).
  • Null handling: optional validity mask with auto-growth and validation.
  • Slicing: zero-copy tuple views or cloned logical slices.

§Intended Use Cases

  • High-performance analytical pipelines requiring dense boolean representation.
  • Interop with Apache Arrow or other columnar formats.
  • Streaming or batch ingestion with incremental append.

§Performance Notes

  • Bulk operations (set_bits_chunk, push_bits) are preferred over per-element writes.
  • Avoid get in tight loops when null-free; use iterators or get_unchecked.
  • Parallel iteration requires the parallel_proc feature.
  • Bitmask: underlying storage type for values and nulls.
  • MaskedArray: trait defining the nullable array API.
  • Vec64: heap storage type for 64-byte aligned vectors.

Structs§

BooleanArray
BooleanArray