pub struct ArrowArray(/* private fields */);Expand description
An owned Arrow C Data Interface array.
Released on drop, unless it was already released, moved out with
into_raw, or handed to
data_chunk_from_arrow — which is why that function takes it by value.
As with ArrowSchema, every accessor returns a neutral value once
is_released is true: the specification leaves the
other fields undefined after release.
Implementations§
Source§impl ArrowArray
impl ArrowArray
Sourcepub const unsafe fn from_raw(raw: RawArrowArray) -> Self
pub const unsafe fn from_raw(raw: RawArrowArray) -> Self
Takes ownership of a filled ABI record.
§Safety
rawmust be a record whosereleasecallback this value may call exactly once, and no other wrapper may hold the same record.- It must be a valid Arrow C Data Interface array:
length,offsetandnull_counttrue, and every buffer, child and dictionary pointer valid for the lengths and offsets the record and its descendants declare. The safe accessors here anddata_chunk_from_arrowread through those pointers; the Arrow C Data Interface carries no sizes that could be checked instead.
Sourcepub const unsafe fn take_from(ptr: *mut RawArrowArray) -> Self
pub const unsafe fn take_from(ptr: *mut RawArrowArray) -> Self
Moves the record out of ptr, leaving a released placeholder behind.
§Safety
ptrmust be valid for reads and writes and properly aligned forRawArrowArray.- The caller must not use the record behind
ptrafterwards. - The record behind
ptrmust meetfrom_raw’s contract: this value calls itsreleasecallback, and the safe accessors anddata_chunk_from_arrowread through its pointers.
Sourcepub fn into_raw(self) -> RawArrowArray
pub fn into_raw(self) -> RawArrowArray
Relinquishes ownership, returning the ABI record.
The caller becomes responsible for calling release on it.
Sourcepub const fn as_ptr(&self) -> *const RawArrowArray
pub const fn as_ptr(&self) -> *const RawArrowArray
A pointer to the ABI record, for C APIs that read it.
Sourcepub const fn as_mut_ptr(&mut self) -> *mut RawArrowArray
pub const fn as_mut_ptr(&mut self) -> *mut RawArrowArray
A mutable pointer to the ABI record, for C APIs that fill it.
Sourcepub const fn is_released(&self) -> bool
pub const fn is_released(&self) -> bool
Whether release is null — either never filled, or already released.
Sourcepub const fn null_count(&self) -> i64
pub const fn null_count(&self) -> i64
Number of null entries, or -1 when the producer did not compute it.
Sourcepub fn child_count(&self) -> usize
pub fn child_count(&self) -> usize
Number of child arrays — the column count, for the struct array a
converted DuckDB chunk produces. 0 once released.