Skip to main content

Module array_view

Module array_view 

Source
Expand description

§ArrayView Module - Windowed View over an Array

ArrayV is a logical, read-only, zero-copy view into a contiguous window [offset .. offset + len) of any Array variant.

§Purpose

  • Provides indexable, bounds-checked access to a subrange of an array without copying buffers.
  • Caches null counts per view for efficient repeated queries.
  • Acts as a unifying abstraction for windowed operations across all array types.

§Behaviour

  • All indices are relative to the view’s start.
  • Internally retains an Arc reference to the parent array’s buffers.
  • Windowing and slicing are O(1) operations (pointer + metadata updates only).
  • Cached null counts are stored in an OnceLock for thread-safe lazy initialization.

§Threading

  • Thread-safe for sharing across threads (uses OnceLock for null count caching).
  • Safe to share via Arc for parallel processing.

§Interop

§Invariants

  • offset + len <= array.len()
  • len reflects the logical number of elements in the view.

Structs§

ArrayV
ArrayView