Expand description
§Internal Macros - Automates boilerplate Array implementations
Utilities to remove boilerplate when building Minarrow array types, trait impls, and enum dispatch. These macros keep array definitions small and consistent.
§Included macros
impl_numeric_array_constructors!- adds common constructors (new,with_capacity,from_slice) to “numeric-shaped” arrays that storedata: Buffer<T>and an optionalnull_mask.impl_masked_array!- implements the core [MaskedArray] trait for a given array type and element bound, including getters/setters, iterators, slicing (slice_clone), and null-mask handling.impl_from_vec_primitive!- adds zero-copy builders (from_vec64,from_vec) for arrays backed byVec64<T>(and friends).match_array!- concise enum dispatch helper over [Array] variants; calls the same method on the active variant and returns a default otherwise.impl_usize_conversions!- implements losslessusizeconversions for integer offset/index types used across the crate.impl_array_ref_deref!- generatesAsRef,AsMut,Deref,DerefMutto expose the inner value buffer as slices, for generic or concrete arrays.impl_arc_masked_array!- implements [MaskedArray] forArc<Inner>, enabling clone-on-write mutation and makingArcarrays usable with view APIs.
§Notes
- Macros assume Minarrow’s standard field layout (e.g.,
data,null_mask), and will not fit bespoke shapes without tweaks. - Safety docs generated by the macros apply to the produced methods (e.g. the
*_uncheckedpaths). Use only when preconditions are guaranteed. - Feature gates (
parallel_proc,views, etc.) are respected where relevant.