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
Arcreference to the parent array’s buffers. - Windowing and slicing are O(1) operations (pointer + metadata updates only).
- Cached null counts are stored in a
Cellfor fast repeated access.
§Threading
- Not thread-safe due to
Cell. - For parallelism, create per-thread clones with
slice.
§Interop
- Convert back to a full array via
to_array. - Promote to
(Array, offset, len)tuple withas_tuple. - Access raw data pointer and element size via
data_ptr_and_byte_len.
§Invariants
offset + len <= array.len()lenreflects the logical number of elements in the view.
Structs§
- ArrayV
- ArrayView