pub struct FFI_ArrowArray { /* private fields */ }ffi only.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)
}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 release(&self) -> Option<unsafe extern "C" fn(arg1: *mut FFI_ArrowArray)>
pub fn release(&self) -> Option<unsafe extern "C" fn(arg1: *mut FFI_ArrowArray)>
Returns the producer-provided release callback, if any.
Sourcepub fn private_data(&self) -> *mut c_void
pub fn private_data(&self) -> *mut c_void
Returns the opaque producer-provided private data pointer.
Sourcepub unsafe fn set_release(
&mut self,
release: Option<unsafe extern "C" fn(arg1: *mut FFI_ArrowArray)>,
) -> Option<unsafe extern "C" fn(arg1: *mut FFI_ArrowArray)>
pub unsafe fn set_release( &mut self, release: Option<unsafe extern "C" fn(arg1: *mut FFI_ArrowArray)>, ) -> Option<unsafe extern "C" fn(arg1: *mut FFI_ArrowArray)>
Replaces the release callback, returning the previous one.
Lets a consumer wrap release: save the old callback, install its own, and chain back on drop. See https://github.com/apache/arrow-rs/issues/9771.
§Safety
Drop calls this callback with a pointer to self. The new callback
must correctly release this array (usually by chaining to the returned
one) and must match the FFI_ArrowArray::private_data it reads. A
wrong callback is undefined behavior on drop.
Sourcepub unsafe fn set_private_data(
&mut self,
private_data: *mut c_void,
) -> *mut c_void
pub unsafe fn set_private_data( &mut self, private_data: *mut c_void, ) -> *mut c_void
Replaces the private data pointer, returning the previous one.
§Safety
The old pointer is returned without being freed; the caller owns it from
here. The new pointer must match what the current
FFI_ArrowArray::release callback expects.
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
§Panics
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