Expand description
§View Trait Module - Standardises Slicing and View Moves in Minarrow
Zero-copy array view abstractions for MinArrow.
This module defines the View trait, which provides a unified interface
for creating lightweight, zero-copy “windows” into arrays without duplicating
their underlying buffers.
It supports three main access patterns:
- Native slices – direct
&[T]or&[u8]access for fixed- and variable-width types. - ArrayView – a typed, windowed view backed by
Arc-cloned array data. - TupleView – a minimal
(&Array, offset, length)form for maximum performance.
These views allow efficient subsetting, iteration, and type-specific access
(.num(), .text(), .dt(), .bool()), while preserving the semantics of
the original array type.
Unlike Apache Arrow’s trait-based array references, MinArrow stores its arrays
in a concrete Array type already holding an Arc to its inner buffers.
This means ArrayView only needs to enforce logical offset/length constraints,
avoiding additional indirection or ref-counting overhead.
Use these abstractions in pipelines, joins, and analytic operations where you need read-only views over subsets of arrays without copying or reallocation.
Traits§
- View
- View trait