Trait rerun::external::re_chunk_store::external::arrow2::array::Array

pub trait Array: Send + Sync + DynClone + 'static {
Show 16 methods // Required methods fn as_any(&self) -> &(dyn Any + 'static); fn as_any_mut(&mut self) -> &mut (dyn Any + 'static); fn len(&self) -> usize; fn data_type(&self) -> &DataType; fn validity(&self) -> Option<&Bitmap>; fn slice(&mut self, offset: usize, length: usize); unsafe fn slice_unchecked(&mut self, offset: usize, length: usize); fn with_validity(&self, validity: Option<Bitmap>) -> Box<dyn Array>; fn to_boxed(&self) -> Box<dyn Array>; // Provided methods fn is_empty(&self) -> bool { ... } fn null_count(&self) -> usize { ... } fn is_null(&self, i: usize) -> bool { ... } unsafe fn is_null_unchecked(&self, i: usize) -> bool { ... } fn is_valid(&self, i: usize) -> bool { ... } fn sliced(&self, offset: usize, length: usize) -> Box<dyn Array> { ... } unsafe fn sliced_unchecked( &self, offset: usize, length: usize ) -> Box<dyn Array> { ... }
}
Expand description

A trait representing an immutable Arrow array. Arrow arrays are trait objects that are infallibly downcasted to concrete types according to the Array::data_type.

Required Methods§

fn as_any(&self) -> &(dyn Any + 'static)

Converts itself to a reference of Any, which enables downcasting to concrete types.

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts itself to a mutable reference of Any, which enables mutable downcasting to concrete types.

fn len(&self) -> usize

The length of the Array. Every array has a length corresponding to the number of elements (slots).

fn data_type(&self) -> &DataType

The DataType of the Array. In combination with Array::as_any, this can be used to downcast trait objects (dyn Array) to concrete arrays.

fn validity(&self) -> Option<&Bitmap>

The validity of the Array: every array has an optional Bitmap that, when available specifies whether the array slot is valid or not (null). When the validity is None, all slots are valid.

fn slice(&mut self, offset: usize, length: usize)

Slices this Array.

§Implementation

This operation is O(1) over len.

§Panic

This function panics iff offset + length > self.len().

unsafe fn slice_unchecked(&mut self, offset: usize, length: usize)

Slices the Array.

§Implementation

This operation is O(1).

§Safety

The caller must ensure that offset + length <= self.len()

fn with_validity(&self, validity: Option<Bitmap>) -> Box<dyn Array>

Clones this Array with a new new assigned bitmap.

§Panic

This function panics iff validity.len() != self.len().

fn to_boxed(&self) -> Box<dyn Array>

Clone a &dyn Array to an owned Box<dyn Array>.

Provided Methods§

fn is_empty(&self) -> bool

whether the array is empty

fn null_count(&self) -> usize

The number of null slots on this Array.

§Implementation

This is O(1) since the number of null elements is pre-computed.

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

Returns whether slot i is null.

§Panic

Panics iff i >= self.len().

unsafe fn is_null_unchecked(&self, i: usize) -> bool

Returns whether slot i is null.

§Safety

The caller must ensure i < self.len()

fn is_valid(&self, i: usize) -> bool

Returns whether slot i is valid.

§Panic

Panics iff i >= self.len().

fn sliced(&self, offset: usize, length: usize) -> Box<dyn Array>

Returns a slice of this Array.

§Implementation

This operation is O(1) over len.

§Panic

This function panics iff offset + length > self.len().

unsafe fn sliced_unchecked( &self, offset: usize, length: usize ) -> Box<dyn Array>

Returns a slice of this Array.

§Implementation

This operation is O(1) over len, as it amounts to increase two ref counts and moving the struct to the heap.

§Safety

The caller must ensure that offset + length <= self.len()

Trait Implementations§

§

impl<'a> AsRef<dyn Array + 'a> for dyn Array

§

fn as_ref(&self) -> &(dyn Array + 'a)

Converts this type into a shared reference of the (usually inferred) input type.
§

impl<'clone> Clone for Box<dyn Array + 'clone>

§

fn clone(&self) -> Box<dyn Array + 'clone>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<'clone> Clone for Box<dyn Array + Send + 'clone>

§

fn clone(&self) -> Box<dyn Array + Send + 'clone>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<'clone> Clone for Box<dyn Array + Sync + Send + 'clone>

§

fn clone(&self) -> Box<dyn Array + Sync + Send + 'clone>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<'clone> Clone for Box<dyn Array + Sync + 'clone>

§

fn clone(&self) -> Box<dyn Array + Sync + 'clone>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for dyn Array + '_

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<&dyn Array> for Box<dyn Array>

§

fn from(value: &dyn Array) -> Box<dyn Array>

Converts to this type from the input type.
§

impl From<&(dyn Array + 'static)> for Arc<dyn Array>

§

fn from(value: &(dyn Array + 'static)) -> Arc<dyn Array>

Converts to this type from the input type.
§

impl From<Arc<dyn Array>> for Box<dyn Array>

§

fn from(value: Arc<dyn Array>) -> Box<dyn Array>

Converts to this type from the input type.
§

impl<O> PartialEq<&(dyn Array + 'static)> for BinaryArray<O>
where O: Offset,

§

fn eq(&self, other: &&(dyn Array + 'static)) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<&(dyn Array + 'static)> for BooleanArray

§

fn eq(&self, other: &&(dyn Array + 'static)) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<K> PartialEq<&(dyn Array + 'static)> for DictionaryArray<K>
where K: DictionaryKey,

§

fn eq(&self, other: &&(dyn Array + 'static)) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<&(dyn Array + 'static)> for FixedSizeBinaryArray

§

fn eq(&self, other: &&(dyn Array + 'static)) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<&(dyn Array + 'static)> for FixedSizeListArray

§

fn eq(&self, other: &&(dyn Array + 'static)) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<O> PartialEq<&(dyn Array + 'static)> for ListArray<O>
where O: Offset,

§

fn eq(&self, other: &&(dyn Array + 'static)) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<&(dyn Array + 'static)> for MapArray

§

fn eq(&self, other: &&(dyn Array + 'static)) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<&(dyn Array + 'static)> for NullArray

§

fn eq(&self, other: &&(dyn Array + 'static)) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<T> PartialEq<&(dyn Array + 'static)> for PrimitiveArray<T>
where T: NativeType,

§

fn eq(&self, other: &&(dyn Array + 'static)) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<&(dyn Array + 'static)> for StructArray

§

fn eq(&self, other: &&(dyn Array + 'static)) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<&(dyn Array + 'static)> for UnionArray

§

fn eq(&self, other: &&(dyn Array + 'static)) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<O> PartialEq<&(dyn Array + 'static)> for Utf8Array<O>
where O: Offset,

§

fn eq(&self, other: &&(dyn Array + 'static)) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<O> PartialEq<BinaryArray<O>> for &(dyn Array + 'static)
where O: Offset,

§

fn eq(&self, other: &BinaryArray<O>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<T> PartialEq<PrimitiveArray<T>> for &(dyn Array + 'static)
where T: NativeType,

§

fn eq(&self, other: &PrimitiveArray<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<O> PartialEq<Utf8Array<O>> for &(dyn Array + 'static)
where O: Offset,

§

fn eq(&self, other: &Utf8Array<O>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<dyn Array> for Arc<dyn Array + '_>

§

fn eq(&self, that: &(dyn Array + 'static)) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<dyn Array> for Box<dyn Array + '_>

§

fn eq(&self, that: &(dyn Array + 'static)) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq for dyn Array + '_

§

fn eq(&self, that: &(dyn Array + 'static)) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl SizeBytes for Box<dyn Array>

source§

fn heap_size_bytes(&self) -> u64

Returns the total size of self on the heap, in bytes.
source§

fn total_size_bytes(&self) -> u64

Returns the total size of self in bytes, accounting for both stack and heap space.
source§

fn stack_size_bytes(&self) -> u64

Returns the total size of self on the stack, in bytes. Read more
source§

fn is_pod() -> bool

Is Self just plain old data? Read more
source§

impl SizeBytes for dyn Array

source§

fn heap_size_bytes(&self) -> u64

Returns the total size of self on the heap, in bytes.
source§

fn total_size_bytes(&self) -> u64

Returns the total size of self in bytes, accounting for both stack and heap space.
source§

fn stack_size_bytes(&self) -> u64

Returns the total size of self on the stack, in bytes. Read more
source§

fn is_pod() -> bool

Is Self just plain old data? Read more

Implementors§

§

impl Array for BooleanArray

§

impl Array for FixedSizeBinaryArray

§

impl Array for FixedSizeListArray

§

impl Array for MapArray

§

impl Array for NullArray

§

impl Array for StructArray

§

impl Array for UnionArray

§

impl<K> Array for DictionaryArray<K>
where K: DictionaryKey,

§

impl<O> Array for BinaryArray<O>
where O: Offset,

§

impl<O> Array for ListArray<O>
where O: Offset,

§

impl<O> Array for Utf8Array<O>
where O: Offset,

§

impl<T> Array for PrimitiveArray<T>
where T: NativeType,