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

    // Required methods
    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§

type Item: Send + Sync

The Arrow type of the element being accessed.

Required Methods§

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

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§

§

impl ArrayAccessor for FixedSizeListArray

§

type Item = Arc<dyn Array, Global>

§

impl<'a> ArrayAccessor for &'a BooleanArray

§

type Item = bool

§

impl<'a> ArrayAccessor for &'a FixedSizeBinaryArray

§

type Item = &'a [u8]

§

impl<'a> ArrayAccessor for &'a FixedSizeListArray

§

type Item = Arc<dyn Array, Global>

§

impl<'a> ArrayAccessor for &'a MapArray

§

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

§

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

§

type Item = Arc<dyn Array, Global>

§

impl<'a, R, V> ArrayAccessor for TypedRunArray<'a, R, V>where R: RunEndIndexType, V: Sync + Send, &'a V: ArrayAccessor, <&'a V as ArrayAccessor>::Item: Default,

§

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

§

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

§

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