Trait arrow2::array::Array [−][src]
pub trait Array: Debug + Send + Sync { fn as_any(&self) -> &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>; 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 infalibly downcasted to concrete types according to the Array::data_type
.
Required methods
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()
.
Provided methods
fn null_count(&self) -> usize
fn null_count(&self) -> usize
The number of null slots on this Array
. This is usually used to branch
implementations to cases where optimizations can be made.
Implementation
This is O(1)
.