Skip to main content

MaskedArray

Trait MaskedArray 

Source
pub trait MaskedArray {
    type T: Default + PartialEq + Clone + Copy;
    type Container;
    type LogicalType: Default;
    type CopyType: Default;

Show 36 methods // Required methods fn len(&self) -> usize; fn data(&self) -> &Self::Container; fn data_mut(&mut self) -> &mut Self::Container; fn get(&self, idx: usize) -> Option<Self::CopyType>; fn set(&mut self, idx: usize, value: Self::LogicalType); unsafe fn get_unchecked(&self, idx: usize) -> Option<Self::CopyType>; unsafe fn set_unchecked(&mut self, idx: usize, value: Self::LogicalType); fn iter(&self) -> impl Iterator<Item = Self::CopyType>; fn iter_opt(&self) -> impl Iterator<Item = Option<Self::CopyType>>; fn iter_range( &self, offset: usize, len: usize, ) -> impl Iterator<Item = Self::CopyType>; fn iter_opt_range( &self, offset: usize, len: usize, ) -> impl Iterator<Item = Option<Self::CopyType>>; fn push(&mut self, value: Self::LogicalType); unsafe fn push_unchecked(&mut self, value: Self::LogicalType); fn slice_clone(&self, offset: usize, len: usize) -> Self; fn resize(&mut self, n: usize, value: Self::LogicalType); fn null_mask(&self) -> Option<&Bitmask>; fn null_mask_mut(&mut self) -> Option<&mut Bitmask>; fn set_null_mask(&mut self, mask: Option<Bitmask>); fn append_array(&mut self, other: &Self); fn append_range( &mut self, other: &Self, offset: usize, len: usize, ) -> Result<(), MinarrowError>; fn insert_rows( &mut self, index: usize, other: &Self, ) -> Result<(), MinarrowError>; fn split(self, index: usize) -> Result<(Self, Self), MinarrowError> where Self: Sized; fn extend_from_iter_with_capacity<I>( &mut self, iter: I, additional_capacity: usize, ) where I: Iterator<Item = Self::LogicalType>; fn extend_from_slice(&mut self, slice: &[Self::LogicalType]); fn fill(value: Self::LogicalType, count: usize) -> Self; // Provided methods fn is_empty(&self) -> bool { ... } fn tuple_ref(&self, offset: usize, len: usize) -> (&Self, usize, usize) { ... } fn is_null(&self, idx: usize) -> bool { ... } fn is_nullable(&self) -> bool { ... } fn null_count(&self) -> usize { ... } fn push_null(&mut self) { ... } unsafe fn push_null_unchecked(&mut self) { ... } fn set_null(&mut self, idx: usize) { ... } unsafe fn set_null_unchecked(&mut self, idx: usize) { ... } fn push_nulls(&mut self, n: usize) { ... } unsafe fn push_nulls_unchecked(&mut self, n: usize) { ... }
}
Expand description

§MaskedArray

MaskedArray is implemented by all inner, nullable arrays.

§Purpose

  • MaskedArray ensures interface consistency across BooleanArray, CategoricalArray, DatetimeArray, FloatArray, IntegerArray and StringArray.
  • It avoids repeition through default boilerplate implementations, focusing on null value handling.
  • This serves to enforce the base pattern contract, and is either overriden on non-fixed width types (e.g., BooleanArray, StringArray), or, for fixed width types (e.g., FloatArray, IntegerArray), is supported by macros.

Required Associated Types§

Source

type T: Default + PartialEq + Clone + Copy

The element type (e.g. f32, bool, etc.) Or, utility type e.g., Offsets for cases like String

Source

type Container

The backing store (e.g. Vec64<Self::Elem> or Bitmask)

Source

type LogicalType: Default

The logical type that the data carries

Source

type CopyType: Default

The type that implements Copy (e.g., &str)

Required Methods§

Source

fn len(&self) -> usize


The below methods differ for the Boolean (bit-packed), and String (variable-length) variants and thus are implemented via macros for the standard variants, and then implemented on those types directly


Returns the number of elements in the array.

Source

fn data(&self) -> &Self::Container

Returns a reference to the underlying data.

Source

fn data_mut(&mut self) -> &mut Self::Container

Returns a mutable reference to the underlying data.

Source

fn get(&self, idx: usize) -> Option<Self::CopyType>

Retrieves the value at the given index, or None if null or beyond length.

Source

fn set(&mut self, idx: usize, value: Self::LogicalType)

Sets the value at the given index, updating the null‐mask.

Source

unsafe fn get_unchecked(&self, idx: usize) -> Option<Self::CopyType>

Like get, but skips the idx >= len() check.

Source

unsafe fn set_unchecked(&mut self, idx: usize, value: Self::LogicalType)

Like set, but skips bounds checks.

Source

fn iter(&self) -> impl Iterator<Item = Self::CopyType>

Returns an iterator over the T values in this array.

Source

fn iter_opt(&self) -> impl Iterator<Item = Option<Self::CopyType>>

Returns an iterator over the T values, as Option<Self::T>.

Source

fn iter_range( &self, offset: usize, len: usize, ) -> impl Iterator<Item = Self::CopyType>

Returns an iterator over a range of T values in this array.

Source

fn iter_opt_range( &self, offset: usize, len: usize, ) -> impl Iterator<Item = Option<Self::CopyType>>

Returns an iterator over a range of T values, as Option<T>.

Source

fn push(&mut self, value: Self::LogicalType)

Appends a value to the array, updating masks if present.

Source

unsafe fn push_unchecked(&mut self, value: Self::LogicalType)

Appends a value to the array, updating masks if present, without bounds checks.

§Safety

The caller must make sure there is enough pre-allocated size in the array, and no thread contention.

Source

fn slice_clone(&self, offset: usize, len: usize) -> Self

Returns a logical slice of the MaskedArraySelf::T [offset, offset+len) as a new MaskedArraySelf::T object via clone.

Prefer View trait slicers for zero-copy.

Source

fn resize(&mut self, n: usize, value: Self::LogicalType)

Resizes the array to contain n elements, via a call into self.data.resize().

If n is greater than the current length, new elements are added using T::default(). If n is smaller, the array is truncated. This only affects the data buffer, not the null mask.

Source

fn null_mask(&self) -> Option<&Bitmask>


We handle null masks consistently across all variants and thus their implementation sits on the trait, other than trait methods that need to access data state.


Returns a reference to the optional null mask.

Source

fn null_mask_mut(&mut self) -> Option<&mut Bitmask>

Returns a mutable reference to the optional null mask.

Source

fn set_null_mask(&mut self, mask: Option<Bitmask>)

Sets the null mask.

Source

fn append_array(&mut self, other: &Self)

Appends all values (and null mask if present) from other to self.

The appended array must be of the same concrete type and element type.

If this array is wrapped in a FieldArray, it will not be possible to mutate the array without reconstructing first, and a ChunkedArray is an alternative option.

Source

fn append_range( &mut self, other: &Self, offset: usize, len: usize, ) -> Result<(), MinarrowError>

Appends rows [offset..offset+len) from another array into self.

Like append_array but for a sub-range. Data and null masks are extended from the source range. The destination grows via its backing allocator.

Source

fn insert_rows( &mut self, index: usize, other: &Self, ) -> Result<(), MinarrowError>

Inserts all values (and null mask if present) from other into self at the specified index.

The inserted array must be of the same concrete type and element type. Elements at and after index are shifted to make room for the inserted values.

§Performance

This is an O(n) operation, where n is the number of elements that need to be shifted. For appending to the end, prefer append_array which is more efficient.

§Arguments
  • index - Position before which to insert (0 = prepend, self.len() = append)
  • other - Array to insert
§Errors

Returns an error if:

  • index > self.len() (out of bounds)
  • Type mismatch between self and other (for enum variants)
§Example
let mut arr = IntegerArray::from(vec![1, 2, 5, 6]);
let insert = IntegerArray::from(vec![3, 4]);
arr.insert_rows(2, &insert)?; // Now: [1, 2, 3, 4, 5, 6]
Source

fn split(self, index: usize) -> Result<(Self, Self), MinarrowError>
where Self: Sized,

Splits this array at the specified index, consuming self and returning two arrays.

The original array’s memory is split between the two resulting arrays without copying. The first array contains elements [0..index), the second contains [index..len).

§Arguments
  • index - Position to split at (0 < index < len)
§Errors
  • Returns an error if index == 0 or index >= len()
§Returns

A tuple of (before, after) where before contains [0..index) and after contains [index..len)

Source

fn extend_from_iter_with_capacity<I>( &mut self, iter: I, additional_capacity: usize, )
where I: Iterator<Item = Self::LogicalType>,

Extends the array from an iterator with pre-allocated capacity.

Pre-allocates the specified additional capacity to avoid reallocations during bulk insertion, providing optimal performance for large datasets where the final size is known in advance.

Source

fn extend_from_slice(&mut self, slice: &[Self::LogicalType])

Extends the array from a slice of values.

More efficient than individual push operations as it pre-allocates capacity and can use bulk copy operations for compatible data types. For variable-length types like strings, calculates total byte requirements upfront.

Source

fn fill(value: Self::LogicalType, count: usize) -> Self

Creates a new array filled with the specified value repeated count times.

Pre-allocates exact capacity to avoid reallocations and uses efficient bulk operations where possible. For string types, calculates total byte requirements to minimise memory overhead.

Provided Methods§

Source

fn is_empty(&self) -> bool

Returns true if the array is empty.

Source

fn tuple_ref(&self, offset: usize, len: usize) -> (&Self, usize, usize)

Low-level accessor for when working directly with mutable array variants.

Borrows with window parameters as a tuple, for ‘DIY’ window access, retaining access to the whole original array.

Offset and Length are usize aliases.

For the standard zero-copy accessors, see the View trait.

Source

fn is_null(&self, idx: usize) -> bool

Returns true if the value at the given index is null.

Source

fn is_nullable(&self) -> bool

Checks if the array has a null bitmask.

Source

fn null_count(&self) -> usize

Returns the total number of nulls.

Source

fn push_null(&mut self)

Append a null value to the array, creating mask if needed

Source

unsafe fn push_null_unchecked(&mut self)

Appends a null value without any bounds‐checks on the mask.

§Safety

You must ensure that after push, the data and mask (if present) have capacity for the new index, or you risk OOB on either.

Source

fn set_null(&mut self, idx: usize)

Marks the value at the given index as null.

Source

unsafe fn set_null_unchecked(&mut self, idx: usize)

Like set_null, but skips bounds checks.

Source

fn push_nulls(&mut self, n: usize)

Bulk-extend this array with n null entries

Source

unsafe fn push_nulls_unchecked(&mut self, n: usize)

Bulk-extend this array with n null entries, using unchecked mask writes.

§Safety

Caller must ensure there are no data races across threads on this mask.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl MaskedArray for Arc<BooleanArray<()>>

Source§

fn extend_from_iter_with_capacity<I>( &mut self, iter: I, additional_capacity: usize, )

Extends the array from an iterator with pre-allocated capacity. Uses copy-on-write semantics - clones array data if Arc reference count > 1.

Source§

fn extend_from_slice( &mut self, slice: &[<Arc<BooleanArray<()>> as MaskedArray>::LogicalType], )

Extends the array from a slice of values. Uses copy-on-write semantics - clones array data if Arc reference count > 1.

Source§

fn fill( value: <Arc<BooleanArray<()>> as MaskedArray>::LogicalType, count: usize, ) -> Arc<BooleanArray<()>>

Creates a new Arc-wrapped array filled with the specified value repeated count times. Returns a new Arc instance with optimally allocated and filled array data.

Source§

type T = bool

Source§

type Container = Bitmask

Source§

type LogicalType = bool

Source§

type CopyType = bool

Source§

fn len(&self) -> usize

Source§

fn is_empty(&self) -> bool

Source§

fn data(&self) -> &<Arc<BooleanArray<()>> as MaskedArray>::Container

Source§

fn data_mut(&mut self) -> &mut <Arc<BooleanArray<()>> as MaskedArray>::Container

Source§

fn get( &self, idx: usize, ) -> Option<<Arc<BooleanArray<()>> as MaskedArray>::CopyType>

Source§

fn set( &mut self, idx: usize, value: <Arc<BooleanArray<()>> as MaskedArray>::LogicalType, )

Source§

unsafe fn get_unchecked( &self, idx: usize, ) -> Option<<Arc<BooleanArray<()>> as MaskedArray>::CopyType>

Source§

unsafe fn set_unchecked( &mut self, idx: usize, value: <Arc<BooleanArray<()>> as MaskedArray>::LogicalType, )

Source§

fn iter( &self, ) -> impl Iterator<Item = <Arc<BooleanArray<()>> as MaskedArray>::CopyType>

Source§

fn iter_opt( &self, ) -> impl Iterator<Item = Option<<Arc<BooleanArray<()>> as MaskedArray>::CopyType>>

Source§

fn iter_range( &self, offset: usize, len: usize, ) -> impl Iterator<Item = <Arc<BooleanArray<()>> as MaskedArray>::CopyType>

Source§

fn iter_opt_range( &self, offset: usize, len: usize, ) -> impl Iterator<Item = Option<<Arc<BooleanArray<()>> as MaskedArray>::CopyType>>

Source§

fn push(&mut self, value: <Arc<BooleanArray<()>> as MaskedArray>::LogicalType)

Source§

unsafe fn push_unchecked( &mut self, value: <Arc<BooleanArray<()>> as MaskedArray>::LogicalType, )

Source§

fn slice_clone(&self, offset: usize, len: usize) -> Arc<BooleanArray<()>>

Source§

fn resize( &mut self, n: usize, value: <Arc<BooleanArray<()>> as MaskedArray>::LogicalType, )

Source§

fn null_mask(&self) -> Option<&Bitmask>

Source§

fn null_mask_mut(&mut self) -> Option<&mut Bitmask>

Source§

fn set_null_mask(&mut self, mask: Option<Bitmask>)

Source§

fn append_array(&mut self, other: &Arc<BooleanArray<()>>)

Source§

fn append_range( &mut self, other: &Arc<BooleanArray<()>>, offset: usize, len: usize, ) -> Result<(), MinarrowError>

Source§

fn insert_rows( &mut self, index: usize, other: &Arc<BooleanArray<()>>, ) -> Result<(), MinarrowError>

Source§

fn split( self, index: usize, ) -> Result<(Arc<BooleanArray<()>>, Arc<BooleanArray<()>>), MinarrowError>

Source§

impl<T> MaskedArray for Arc<CategoricalArray<T>>
where T: Integer,

Source§

fn extend_from_iter_with_capacity<I>( &mut self, iter: I, additional_capacity: usize, )

Extends the array from an iterator with pre-allocated capacity. Uses copy-on-write semantics - clones array data if Arc reference count > 1.

Source§

fn extend_from_slice( &mut self, slice: &[<Arc<CategoricalArray<T>> as MaskedArray>::LogicalType], )

Extends the array from a slice of values. Uses copy-on-write semantics - clones array data if Arc reference count > 1.

Source§

fn fill( value: <Arc<CategoricalArray<T>> as MaskedArray>::LogicalType, count: usize, ) -> Arc<CategoricalArray<T>>

Creates a new Arc-wrapped array filled with the specified value repeated count times. Returns a new Arc instance with optimally allocated and filled array data.

Source§

type T = T

Source§

type Container = Buffer<T>

Source§

type LogicalType = String

Source§

type CopyType = &'static str

Source§

fn len(&self) -> usize

Source§

fn is_empty(&self) -> bool

Source§

fn data(&self) -> &<Arc<CategoricalArray<T>> as MaskedArray>::Container

Source§

fn data_mut( &mut self, ) -> &mut <Arc<CategoricalArray<T>> as MaskedArray>::Container

Source§

fn get( &self, idx: usize, ) -> Option<<Arc<CategoricalArray<T>> as MaskedArray>::CopyType>

Source§

fn set( &mut self, idx: usize, value: <Arc<CategoricalArray<T>> as MaskedArray>::LogicalType, )

Source§

unsafe fn get_unchecked( &self, idx: usize, ) -> Option<<Arc<CategoricalArray<T>> as MaskedArray>::CopyType>

Source§

unsafe fn set_unchecked( &mut self, idx: usize, value: <Arc<CategoricalArray<T>> as MaskedArray>::LogicalType, )

Source§

fn iter( &self, ) -> impl Iterator<Item = <Arc<CategoricalArray<T>> as MaskedArray>::CopyType>

Source§

fn iter_opt( &self, ) -> impl Iterator<Item = Option<<Arc<CategoricalArray<T>> as MaskedArray>::CopyType>>

Source§

fn iter_range( &self, offset: usize, len: usize, ) -> impl Iterator<Item = <Arc<CategoricalArray<T>> as MaskedArray>::CopyType>

Source§

fn iter_opt_range( &self, offset: usize, len: usize, ) -> impl Iterator<Item = Option<<Arc<CategoricalArray<T>> as MaskedArray>::CopyType>>

Source§

fn push( &mut self, value: <Arc<CategoricalArray<T>> as MaskedArray>::LogicalType, )

Source§

unsafe fn push_unchecked( &mut self, value: <Arc<CategoricalArray<T>> as MaskedArray>::LogicalType, )

Source§

fn slice_clone(&self, offset: usize, len: usize) -> Arc<CategoricalArray<T>>

Source§

fn resize( &mut self, n: usize, value: <Arc<CategoricalArray<T>> as MaskedArray>::LogicalType, )

Source§

fn null_mask(&self) -> Option<&Bitmask>

Source§

fn null_mask_mut(&mut self) -> Option<&mut Bitmask>

Source§

fn set_null_mask(&mut self, mask: Option<Bitmask>)

Source§

fn append_array(&mut self, other: &Arc<CategoricalArray<T>>)

Source§

fn append_range( &mut self, other: &Arc<CategoricalArray<T>>, offset: usize, len: usize, ) -> Result<(), MinarrowError>

Source§

fn insert_rows( &mut self, index: usize, other: &Arc<CategoricalArray<T>>, ) -> Result<(), MinarrowError>

Source§

fn split( self, index: usize, ) -> Result<(Arc<CategoricalArray<T>>, Arc<CategoricalArray<T>>), MinarrowError>

Source§

impl<T> MaskedArray for Arc<DatetimeArray<T>>
where T: Integer,

Source§

fn extend_from_iter_with_capacity<I>( &mut self, iter: I, additional_capacity: usize, )
where I: Iterator<Item = <Arc<DatetimeArray<T>> as MaskedArray>::LogicalType>,

Extends the array from an iterator with pre-allocated capacity. Uses copy-on-write semantics - clones array data if Arc reference count > 1.

Source§

fn extend_from_slice( &mut self, slice: &[<Arc<DatetimeArray<T>> as MaskedArray>::LogicalType], )

Extends the array from a slice of values. Uses copy-on-write semantics - clones array data if Arc reference count > 1.

Source§

fn fill( value: <Arc<DatetimeArray<T>> as MaskedArray>::LogicalType, count: usize, ) -> Arc<DatetimeArray<T>>

Creates a new Arc-wrapped array filled with the specified value repeated count times. Returns a new Arc instance with optimally allocated and filled array data.

Source§

type T = T

Source§

type Container = Buffer<T>

Source§

type LogicalType = T

Source§

type CopyType = T

Source§

fn len(&self) -> usize

Source§

fn is_empty(&self) -> bool

Source§

fn data(&self) -> &<Arc<DatetimeArray<T>> as MaskedArray>::Container

Source§

fn data_mut(&mut self) -> &mut <Arc<DatetimeArray<T>> as MaskedArray>::Container

Source§

fn get( &self, idx: usize, ) -> Option<<Arc<DatetimeArray<T>> as MaskedArray>::CopyType>

Source§

fn set( &mut self, idx: usize, value: <Arc<DatetimeArray<T>> as MaskedArray>::LogicalType, )

Source§

unsafe fn get_unchecked( &self, idx: usize, ) -> Option<<Arc<DatetimeArray<T>> as MaskedArray>::CopyType>

Source§

unsafe fn set_unchecked( &mut self, idx: usize, value: <Arc<DatetimeArray<T>> as MaskedArray>::LogicalType, )

Source§

fn iter( &self, ) -> impl Iterator<Item = <Arc<DatetimeArray<T>> as MaskedArray>::CopyType>

Source§

fn iter_opt( &self, ) -> impl Iterator<Item = Option<<Arc<DatetimeArray<T>> as MaskedArray>::CopyType>>

Source§

fn iter_range( &self, offset: usize, len: usize, ) -> impl Iterator<Item = <Arc<DatetimeArray<T>> as MaskedArray>::CopyType>

Source§

fn iter_opt_range( &self, offset: usize, len: usize, ) -> impl Iterator<Item = Option<<Arc<DatetimeArray<T>> as MaskedArray>::CopyType>>

Source§

fn push(&mut self, value: <Arc<DatetimeArray<T>> as MaskedArray>::LogicalType)

Source§

unsafe fn push_unchecked( &mut self, value: <Arc<DatetimeArray<T>> as MaskedArray>::LogicalType, )

Source§

fn slice_clone(&self, offset: usize, len: usize) -> Arc<DatetimeArray<T>>

Source§

fn resize( &mut self, n: usize, value: <Arc<DatetimeArray<T>> as MaskedArray>::LogicalType, )

Source§

fn null_mask(&self) -> Option<&Bitmask>

Source§

fn null_mask_mut(&mut self) -> Option<&mut Bitmask>

Source§

fn set_null_mask(&mut self, mask: Option<Bitmask>)

Source§

fn append_array(&mut self, other: &Arc<DatetimeArray<T>>)

Source§

fn append_range( &mut self, other: &Arc<DatetimeArray<T>>, offset: usize, len: usize, ) -> Result<(), MinarrowError>

Source§

fn insert_rows( &mut self, index: usize, other: &Arc<DatetimeArray<T>>, ) -> Result<(), MinarrowError>

Source§

fn split( self, index: usize, ) -> Result<(Arc<DatetimeArray<T>>, Arc<DatetimeArray<T>>), MinarrowError>

Source§

impl<T> MaskedArray for Arc<FloatArray<T>>
where T: Float,

Source§

fn extend_from_iter_with_capacity<I>( &mut self, iter: I, additional_capacity: usize, )
where I: Iterator<Item = <Arc<FloatArray<T>> as MaskedArray>::LogicalType>,

Extends the array from an iterator with pre-allocated capacity. Uses copy-on-write semantics - clones array data if Arc reference count > 1.

Source§

fn extend_from_slice( &mut self, slice: &[<Arc<FloatArray<T>> as MaskedArray>::LogicalType], )

Extends the array from a slice of values. Uses copy-on-write semantics - clones array data if Arc reference count > 1.

Source§

fn fill( value: <Arc<FloatArray<T>> as MaskedArray>::LogicalType, count: usize, ) -> Arc<FloatArray<T>>

Creates a new Arc-wrapped array filled with the specified value repeated count times. Returns a new Arc instance with optimally allocated and filled array data.

Source§

type T = T

Source§

type Container = Buffer<T>

Source§

type LogicalType = T

Source§

type CopyType = T

Source§

fn len(&self) -> usize

Source§

fn is_empty(&self) -> bool

Source§

fn data(&self) -> &<Arc<FloatArray<T>> as MaskedArray>::Container

Source§

fn data_mut(&mut self) -> &mut <Arc<FloatArray<T>> as MaskedArray>::Container

Source§

fn get( &self, idx: usize, ) -> Option<<Arc<FloatArray<T>> as MaskedArray>::CopyType>

Source§

fn set( &mut self, idx: usize, value: <Arc<FloatArray<T>> as MaskedArray>::LogicalType, )

Source§

unsafe fn get_unchecked( &self, idx: usize, ) -> Option<<Arc<FloatArray<T>> as MaskedArray>::CopyType>

Source§

unsafe fn set_unchecked( &mut self, idx: usize, value: <Arc<FloatArray<T>> as MaskedArray>::LogicalType, )

Source§

fn iter( &self, ) -> impl Iterator<Item = <Arc<FloatArray<T>> as MaskedArray>::CopyType>

Source§

fn iter_opt( &self, ) -> impl Iterator<Item = Option<<Arc<FloatArray<T>> as MaskedArray>::CopyType>>

Source§

fn iter_range( &self, offset: usize, len: usize, ) -> impl Iterator<Item = <Arc<FloatArray<T>> as MaskedArray>::CopyType>

Source§

fn iter_opt_range( &self, offset: usize, len: usize, ) -> impl Iterator<Item = Option<<Arc<FloatArray<T>> as MaskedArray>::CopyType>>

Source§

fn push(&mut self, value: <Arc<FloatArray<T>> as MaskedArray>::LogicalType)

Source§

unsafe fn push_unchecked( &mut self, value: <Arc<FloatArray<T>> as MaskedArray>::LogicalType, )

Source§

fn slice_clone(&self, offset: usize, len: usize) -> Arc<FloatArray<T>>

Source§

fn resize( &mut self, n: usize, value: <Arc<FloatArray<T>> as MaskedArray>::LogicalType, )

Source§

fn null_mask(&self) -> Option<&Bitmask>

Source§

fn null_mask_mut(&mut self) -> Option<&mut Bitmask>

Source§

fn set_null_mask(&mut self, mask: Option<Bitmask>)

Source§

fn append_array(&mut self, other: &Arc<FloatArray<T>>)

Source§

fn append_range( &mut self, other: &Arc<FloatArray<T>>, offset: usize, len: usize, ) -> Result<(), MinarrowError>

Source§

fn insert_rows( &mut self, index: usize, other: &Arc<FloatArray<T>>, ) -> Result<(), MinarrowError>

Source§

fn split( self, index: usize, ) -> Result<(Arc<FloatArray<T>>, Arc<FloatArray<T>>), MinarrowError>

Source§

impl<T> MaskedArray for Arc<IntegerArray<T>>
where T: Integer,

Source§

fn extend_from_iter_with_capacity<I>( &mut self, iter: I, additional_capacity: usize, )
where I: Iterator<Item = <Arc<IntegerArray<T>> as MaskedArray>::LogicalType>,

Extends the array from an iterator with pre-allocated capacity. Uses copy-on-write semantics - clones array data if Arc reference count > 1.

Source§

fn extend_from_slice( &mut self, slice: &[<Arc<IntegerArray<T>> as MaskedArray>::LogicalType], )

Extends the array from a slice of values. Uses copy-on-write semantics - clones array data if Arc reference count > 1.

Source§

fn fill( value: <Arc<IntegerArray<T>> as MaskedArray>::LogicalType, count: usize, ) -> Arc<IntegerArray<T>>

Creates a new Arc-wrapped array filled with the specified value repeated count times. Returns a new Arc instance with optimally allocated and filled array data.

Source§

type T = T

Source§

type Container = Buffer<T>

Source§

type LogicalType = T

Source§

type CopyType = T

Source§

fn len(&self) -> usize

Source§

fn is_empty(&self) -> bool

Source§

fn data(&self) -> &<Arc<IntegerArray<T>> as MaskedArray>::Container

Source§

fn data_mut(&mut self) -> &mut <Arc<IntegerArray<T>> as MaskedArray>::Container

Source§

fn get( &self, idx: usize, ) -> Option<<Arc<IntegerArray<T>> as MaskedArray>::CopyType>

Source§

fn set( &mut self, idx: usize, value: <Arc<IntegerArray<T>> as MaskedArray>::LogicalType, )

Source§

unsafe fn get_unchecked( &self, idx: usize, ) -> Option<<Arc<IntegerArray<T>> as MaskedArray>::CopyType>

Source§

unsafe fn set_unchecked( &mut self, idx: usize, value: <Arc<IntegerArray<T>> as MaskedArray>::LogicalType, )

Source§

fn iter( &self, ) -> impl Iterator<Item = <Arc<IntegerArray<T>> as MaskedArray>::CopyType>

Source§

fn iter_opt( &self, ) -> impl Iterator<Item = Option<<Arc<IntegerArray<T>> as MaskedArray>::CopyType>>

Source§

fn iter_range( &self, offset: usize, len: usize, ) -> impl Iterator<Item = <Arc<IntegerArray<T>> as MaskedArray>::CopyType>

Source§

fn iter_opt_range( &self, offset: usize, len: usize, ) -> impl Iterator<Item = Option<<Arc<IntegerArray<T>> as MaskedArray>::CopyType>>

Source§

fn push(&mut self, value: <Arc<IntegerArray<T>> as MaskedArray>::LogicalType)

Source§

unsafe fn push_unchecked( &mut self, value: <Arc<IntegerArray<T>> as MaskedArray>::LogicalType, )

Source§

fn slice_clone(&self, offset: usize, len: usize) -> Arc<IntegerArray<T>>

Source§

fn resize( &mut self, n: usize, value: <Arc<IntegerArray<T>> as MaskedArray>::LogicalType, )

Source§

fn null_mask(&self) -> Option<&Bitmask>

Source§

fn null_mask_mut(&mut self) -> Option<&mut Bitmask>

Source§

fn set_null_mask(&mut self, mask: Option<Bitmask>)

Source§

fn append_array(&mut self, other: &Arc<IntegerArray<T>>)

Source§

fn append_range( &mut self, other: &Arc<IntegerArray<T>>, offset: usize, len: usize, ) -> Result<(), MinarrowError>

Source§

fn insert_rows( &mut self, index: usize, other: &Arc<IntegerArray<T>>, ) -> Result<(), MinarrowError>

Source§

fn split( self, index: usize, ) -> Result<(Arc<IntegerArray<T>>, Arc<IntegerArray<T>>), MinarrowError>

Source§

impl<T> MaskedArray for Arc<StringArray<T>>
where T: Integer,

Source§

fn extend_from_iter_with_capacity<I>( &mut self, iter: I, additional_capacity: usize, )
where I: Iterator<Item = <Arc<StringArray<T>> as MaskedArray>::LogicalType>,

Extends the array from an iterator with pre-allocated capacity. Uses copy-on-write semantics - clones array data if Arc reference count > 1.

Source§

fn extend_from_slice( &mut self, slice: &[<Arc<StringArray<T>> as MaskedArray>::LogicalType], )

Extends the array from a slice of values. Uses copy-on-write semantics - clones array data if Arc reference count > 1.

Source§

fn fill( value: <Arc<StringArray<T>> as MaskedArray>::LogicalType, count: usize, ) -> Arc<StringArray<T>>

Creates a new Arc-wrapped array filled with the specified value repeated count times. Returns a new Arc instance with optimally allocated and filled array data.

Source§

type T = T

Source§

type Container = Buffer<u8>

Source§

type LogicalType = String

Source§

type CopyType = &'static str

Source§

fn len(&self) -> usize

Source§

fn is_empty(&self) -> bool

Source§

fn data(&self) -> &<Arc<StringArray<T>> as MaskedArray>::Container

Source§

fn data_mut(&mut self) -> &mut <Arc<StringArray<T>> as MaskedArray>::Container

Source§

fn get( &self, idx: usize, ) -> Option<<Arc<StringArray<T>> as MaskedArray>::CopyType>

Source§

fn set( &mut self, idx: usize, value: <Arc<StringArray<T>> as MaskedArray>::LogicalType, )

Source§

unsafe fn get_unchecked( &self, idx: usize, ) -> Option<<Arc<StringArray<T>> as MaskedArray>::CopyType>

Source§

unsafe fn set_unchecked( &mut self, idx: usize, value: <Arc<StringArray<T>> as MaskedArray>::LogicalType, )

Source§

fn iter( &self, ) -> impl Iterator<Item = <Arc<StringArray<T>> as MaskedArray>::CopyType>

Source§

fn iter_opt( &self, ) -> impl Iterator<Item = Option<<Arc<StringArray<T>> as MaskedArray>::CopyType>>

Source§

fn iter_range( &self, offset: usize, len: usize, ) -> impl Iterator<Item = <Arc<StringArray<T>> as MaskedArray>::CopyType>

Source§

fn iter_opt_range( &self, offset: usize, len: usize, ) -> impl Iterator<Item = Option<<Arc<StringArray<T>> as MaskedArray>::CopyType>>

Source§

fn push(&mut self, value: <Arc<StringArray<T>> as MaskedArray>::LogicalType)

Source§

unsafe fn push_unchecked( &mut self, value: <Arc<StringArray<T>> as MaskedArray>::LogicalType, )

Source§

fn slice_clone(&self, offset: usize, len: usize) -> Arc<StringArray<T>>

Source§

fn resize( &mut self, n: usize, value: <Arc<StringArray<T>> as MaskedArray>::LogicalType, )

Source§

fn null_mask(&self) -> Option<&Bitmask>

Source§

fn null_mask_mut(&mut self) -> Option<&mut Bitmask>

Source§

fn set_null_mask(&mut self, mask: Option<Bitmask>)

Source§

fn append_array(&mut self, other: &Arc<StringArray<T>>)

Source§

fn append_range( &mut self, other: &Arc<StringArray<T>>, offset: usize, len: usize, ) -> Result<(), MinarrowError>

Source§

fn insert_rows( &mut self, index: usize, other: &Arc<StringArray<T>>, ) -> Result<(), MinarrowError>

Source§

fn split( self, index: usize, ) -> Result<(Arc<StringArray<T>>, Arc<StringArray<T>>), MinarrowError>

Implementors§

Source§

impl MaskedArray for BooleanArray<()>

Source§

impl<T> MaskedArray for CategoricalArray<T>
where T: Integer,

Source§

impl<T> MaskedArray for DatetimeArray<T>
where T: Integer,

Source§

impl<T> MaskedArray for FloatArray<T>
where T: Float,

Source§

impl<T> MaskedArray for IntegerArray<T>
where T: Integer,

Source§

impl<T> MaskedArray for StringArray<T>
where T: Integer,

⚠️ The string implementation of MaskedArray is primarily to support the type contract, and null handling. Many of the methods have _str variants e.g., get_str vs. get, etc., and are the preferred methods for standard usage. These are inlined accordingly. However, when building on top of the trait contract, one should carefully review the core methods below as there are lifetime workarounds implemented to ensure ergonomic usage within all the other types, due to String behaving differently by default.

In any case, the recommended pattern is to enum match via Array to the _str variants, as the below equivalents have not been inlined with respect to binary size.

See below for further details.