Skip to main content

impl_arc_masked_array

Macro impl_arc_masked_array 

Source
macro_rules! impl_arc_masked_array {
    (
        Inner = $inner:ident < $T:ident >,
        T = $T2:ident,
        Container = $Container:ty,
        LogicalType = $LogicalType:ty,
        CopyType = $CopyType:ty,
        BufferT = $BufferT:ty,
        Variant = $variant:ident,
        Bound = $Bound:path,
    ) => { ... };
    (
        Inner = $inner:ty,
        T = $T:ty,
        Container = $Container:ty,
        LogicalType = $LogicalType:ty,
        CopyType = $CopyType:ty,
        BufferT = $BufferT:ty,
        Variant = $variant:ident
    ) => { ... };
}
Expand description

§Overview

Implements MaskedArray by delegating to the inner type with clone‐on‐write for mutators.

These support accessing MaskedArray methods without needing to dereference.

§View trait building block

MaskedArray for Arc<Inner> is a preliminary requirement for Into<Array>, and View enabling:

  1. View: Zero-copy accessors for slicing and windowed views.
  2. Into<Array>: self-explanatory (convenient conversion to Array).

We implement these under crate::conversions.

§Parameters

  • Inner = $inner:ty - the concrete array type, e.g. BooleanArray<()>
  • T = $T:ty - element type, e.g. bool
  • Container = $Container:ty - backing store, e.g. Bitmask
  • LogicalType = $LogicalType:ty - logical type, e.g. bool
  • CopyType = $CopyType:ty - copy type, e.g. bool
  • BufferT = $BufferT:ty - view buffer type, e.g. u8
  • Variant = $variant:ident - enum variant, e.g. BooleanArray
  • Bound = &Bound:path -

Due to inherent variation, it turns out that all of these parameters are required to support unification, despite appearing overkill at first glance.