pub trait Array:
Debug
+ Send
+ Sync
+ Sealed
+ 'static {
// Required methods
fn as_any(&self) -> &dyn Any;
fn data_type(&self) -> &DataType;
fn len(&self) -> usize;
fn validity(&self) -> Option<&Bitmap>;
fn slice(&self, offset: usize, len: usize) -> ArrayRef;
fn buffer_memory_size(&self) -> usize;
fn equals(&self, other: &dyn Array) -> bool;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn null_count(&self) -> usize { ... }
fn is_null(&self, index: usize) -> bool { ... }
fn is_valid(&self, index: usize) -> bool { ... }
fn children(&self) -> Vec<&ArrayRef> ⓘ { ... }
}Expand description
The behaviour every array family provides.
Sealed: the implementor set is fixed by this crate (see array_kinds).
Required Methods§
Sourcefn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Erased self, for ArrayExt::downcast.
Sourcefn validity(&self) -> Option<&Bitmap>
fn validity(&self) -> Option<&Bitmap>
The validity bitmap, or None when every slot is valid.
Arrow calls this the null buffer; here 1 means valid, matching the
bit convention in crate::buffer::bitmap.
Sourcefn slice(&self, offset: usize, len: usize) -> ArrayRef
fn slice(&self, offset: usize, len: usize) -> ArrayRef
A zero-copy sub-range.
Clamping is the crate-wide convention: offset beyond the end
yields an empty array, and len beyond the end is truncated. Nothing
panics. Use try_slice when an out-of-range request is a bug worth
reporting.
use astrs_data::array::{Array, Int32Array};
let values = Int32Array::from_values([1, 2, 3, 4]);
assert_eq!(Array::slice(&values, 1, 2).len(), 2);
assert_eq!(Array::slice(&values, 3, 99).len(), 1);
assert_eq!(Array::slice(&values, 99, 1).len(), 0);Sourcefn buffer_memory_size(&self) -> usize
fn buffer_memory_size(&self) -> usize
Bytes of buffer memory this array pins, including shared allocations it only partly covers.
Used by the daemon’s memory accounting and by stage 2 to size an IPC body before encoding.
Provided Methods§
Sourcefn null_count(&self) -> usize
fn null_count(&self) -> usize
Number of null slots.
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".