pub trait ArrayAccessor: Array {
    type Item: Send + Sync;

    fn value(&self, index: usize) -> Self::Item;
    unsafe fn value_unchecked(&self, index: usize) -> Self::Item;
}
Expand description

A generic trait for accessing the values of an Array

Validity

An ArrayAccessor must always return a well-defined value for an index that is within the bounds 0..Array::len, including for null indexes where Array::is_null is true.

The value at null indexes is unspecified, and implementations must not rely on a specific value such as Default::default being returned, however, it must not be undefined

Required Associated Types§

source

type Item: Send + Sync

The Arrow type of the element being accessed.

Required Methods§

source

fn value(&self, index: usize) -> Self::Item

Returns the element at index i

Panics

Panics if the value is outside the bounds of the array

source

unsafe fn value_unchecked(&self, index: usize) -> Self::Item

Returns the element at index i

Safety

Caller is responsible for ensuring that the index is within the bounds of the array

Implementors§

source§

impl ArrayAccessor for FixedSizeListArray

§

type Item = Arc<dyn Array + 'static>

source§

impl<'a> ArrayAccessor for &'a BooleanArray

§

type Item = bool

source§

impl<'a> ArrayAccessor for &'a FixedSizeBinaryArray

§

type Item = &'a [u8]

source§

impl<'a, K, V> ArrayAccessor for TypedDictionaryArray<'a, K, V>where
    K: ArrowPrimitiveType,
    V: Sync + Send,
    &'a V: ArrayAccessor,
    <&'a V as ArrayAccessor>::Item: Default,

source§

impl<'a, OffsetSize: OffsetSizeTrait> ArrayAccessor for &'a GenericListArray<OffsetSize>

§

type Item = Arc<dyn Array + 'static>

source§

impl<'a, T: ByteArrayType> ArrayAccessor for &'a GenericByteArray<T>

§

type Item = &'a <T as ByteArrayType>::Native

source§

impl<'a, T: ArrowPrimitiveType> ArrayAccessor for &'a PrimitiveArray<T>