pub trait Array: Send + Sync + DynClone + 'static {
Show 13 methods
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
fn len(&self) -> usize;
fn data_type(&self) -> &DataType;
fn validity(&self) -> Option<&Bitmap>;
fn slice(&self, offset: usize, length: usize) -> Box<dyn Array>;
unsafe fn slice_unchecked(
&self,
offset: usize,
length: usize
) -> Box<dyn Array>;
fn with_validity(&self, validity: Option<Bitmap>) -> Box<dyn Array>;
fn to_boxed(&self) -> Box<dyn Array>;
fn is_empty(&self) -> bool { ... }
fn null_count(&self) -> usize { ... }
fn is_null(&self, i: usize) -> bool { ... }
fn is_valid(&self, i: usize) -> bool { ... }
}
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
Converts itself to a reference of Any
, which enables downcasting to concrete types.
fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Converts itself to a mutable reference of Any
, which enables mutable downcasting to concrete types.
The length of the Array
. Every array has a length corresponding to the number of
elements (slots).
The DataType
of the Array
. In combination with Array::as_any
, this can be
used to downcast trait objects (dyn Array
) to concrete arrays.
Slices the Array
, returning a new Box<dyn Array>
.
Implementation
This operation is O(1)
over len
, as it amounts to increase two ref counts
and moving the struct to the heap.
Panic
This function panics iff offset + length > self.len()
.
Slices the Array
, returning a new Box<dyn 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()
Provided Methods
fn null_count(&self) -> usize
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.
Trait Implementations
sourceimpl<O: Offset> PartialEq<&(dyn Array + 'static)> for BinaryArray<O>
impl<O: Offset> PartialEq<&(dyn Array + 'static)> for BinaryArray<O>
sourceimpl PartialEq<&(dyn Array + 'static)> for BooleanArray
impl PartialEq<&(dyn Array + 'static)> for BooleanArray
sourceimpl<K: DictionaryKey> PartialEq<&(dyn Array + 'static)> for DictionaryArray<K>
impl<K: DictionaryKey> PartialEq<&(dyn Array + 'static)> for DictionaryArray<K>
sourceimpl PartialEq<&(dyn Array + 'static)> for FixedSizeBinaryArray
impl PartialEq<&(dyn Array + 'static)> for FixedSizeBinaryArray
sourceimpl PartialEq<&(dyn Array + 'static)> for FixedSizeListArray
impl PartialEq<&(dyn Array + 'static)> for FixedSizeListArray
sourceimpl<O: Offset> PartialEq<&(dyn Array + 'static)> for ListArray<O>
impl<O: Offset> PartialEq<&(dyn Array + 'static)> for ListArray<O>
sourceimpl PartialEq<&(dyn Array + 'static)> for MapArray
impl PartialEq<&(dyn Array + 'static)> for MapArray
sourceimpl PartialEq<&(dyn Array + 'static)> for NullArray
impl PartialEq<&(dyn Array + 'static)> for NullArray
sourceimpl<T: NativeType> PartialEq<&(dyn Array + 'static)> for PrimitiveArray<T>
impl<T: NativeType> PartialEq<&(dyn Array + 'static)> for PrimitiveArray<T>
sourceimpl PartialEq<&(dyn Array + 'static)> for StructArray
impl PartialEq<&(dyn Array + 'static)> for StructArray
sourceimpl PartialEq<&(dyn Array + 'static)> for UnionArray
impl PartialEq<&(dyn Array + 'static)> for UnionArray
sourceimpl<O: Offset> PartialEq<&(dyn Array + 'static)> for Utf8Array<O>
impl<O: Offset> PartialEq<&(dyn Array + 'static)> for Utf8Array<O>
sourceimpl<O: Offset> PartialEq<BinaryArray<O>> for &dyn Array
impl<O: Offset> PartialEq<BinaryArray<O>> for &dyn Array
sourcefn eq(&self, other: &BinaryArray<O>) -> bool
fn eq(&self, other: &BinaryArray<O>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl<T: NativeType> PartialEq<PrimitiveArray<T>> for &dyn Array
impl<T: NativeType> PartialEq<PrimitiveArray<T>> for &dyn Array
sourcefn eq(&self, other: &PrimitiveArray<T>) -> bool
fn eq(&self, other: &PrimitiveArray<T>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more