#[repr(C)]pub struct FFI_ArrowArray {
pub length: i64,
pub null_count: i64,
pub offset: i64,
pub n_buffers: i64,
pub n_children: i64,
pub buffers: *mut *const c_void,
pub children: *mut *mut FFI_ArrowArray,
pub dictionary: *mut FFI_ArrowArray,
pub release: Option<unsafe extern "C" fn(arg1: *mut FFI_ArrowArray)>,
pub private_data: *mut c_void,
}Expand description
ABI-compatible struct for ArrowArray from C Data Interface See https://arrow.apache.org/docs/format/CDataInterface.html#the-arrowarray-structure
fn export_array(array: &ArrayData) -> FFI_ArrowArray {
FFI_ArrowArray::new(array)
}Fields§
§length: i64Logical length of the array
null_count: i64Number of null items in the array
offset: i64logical offset inside the array
n_buffers: i64Number of physical buffers backing this array
n_children: i64Number of children this array has
buffers: *mut *const c_voidC array of pointers to the start of each physical buffer backing this array
children: *mut *mut FFI_ArrowArrayC array of pointers to each child array of this array
dictionary: *mut FFI_ArrowArrayPointer to the underlying array of dictionary values
release: Option<unsafe extern "C" fn(arg1: *mut FFI_ArrowArray)>Pointer to a producer-provided release callback
private_data: *mut c_voidOpaque pointer to producer-provided private data
When exported, this MUST contain everything that is owned by this array.
For example, any buffer pointed to in buffers must be here, as well
as the buffers pointer itself.
In other words, everything in FFI_ArrowArray must be owned by
private_data and can assume that they do not outlive private_data.
Implementations§
Source§impl FFI_ArrowArray
impl FFI_ArrowArray
Sourcepub unsafe fn from_raw(array: *mut FFI_ArrowArray) -> Self
pub unsafe fn from_raw(array: *mut FFI_ArrowArray) -> Self
Takes ownership of the pointed to FFI_ArrowArray
This acts to move the data out of array, setting the release callback to NULL
§Safety
arraymust be valid for reads and writesarraymust be properly alignedarraymust point to a properly initialized value ofFFI_ArrowArray
Sourcepub fn is_released(&self) -> bool
pub fn is_released(&self) -> bool
Whether the array has been released
Sourcepub fn null_count(&self) -> usize
pub fn null_count(&self) -> usize
the null count of the array
Sourcepub fn null_count_opt(&self) -> Option<usize>
pub fn null_count_opt(&self) -> Option<usize>
Returns the null count, checking for validity
Sourcepub unsafe fn set_null_count(&mut self, null_count: i64)
pub unsafe fn set_null_count(&mut self, null_count: i64)
Sourcepub fn buffer(&self, index: usize) -> *const u8
pub fn buffer(&self, index: usize) -> *const u8
Returns the buffer at the provided index
§Panic
Panics if index >= self.num_buffers() or the buffer is not correctly aligned
Sourcepub fn num_buffers(&self) -> usize
pub fn num_buffers(&self) -> usize
Returns the number of buffers
Sourcepub fn child(&self, index: usize) -> &FFI_ArrowArray
pub fn child(&self, index: usize) -> &FFI_ArrowArray
Returns the child at the provided index
Sourcepub fn num_children(&self) -> usize
pub fn num_children(&self) -> usize
Returns the number of children
Sourcepub fn dictionary(&self) -> Option<&Self>
pub fn dictionary(&self) -> Option<&Self>
Returns the dictionary if any