Struct arrow::array::ffi::FFI_ArrowArray
#[repr(C)]pub struct FFI_ArrowArray {
length: i64,
null_count: i64,
offset: i64,
n_buffers: i64,
n_children: i64,
buffers: *mut *const c_void,
children: *mut *mut FFI_ArrowArray,
dictionary: *mut FFI_ArrowArray,
release: Option<unsafe extern "C" fn(_: *mut FFI_ArrowArray)>,
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#structure-definitions
fn export_array(array: &ArrayData) -> FFI_ArrowArray {
FFI_ArrowArray::new(array)
}
Fields§
§length: i64
§null_count: i64
§offset: i64
§n_buffers: i64
§n_children: i64
§buffers: *mut *const c_void
§children: *mut *mut FFI_ArrowArray
§dictionary: *mut FFI_ArrowArray
§release: Option<unsafe extern "C" fn(_: *mut FFI_ArrowArray)>
§private_data: *mut c_void
Implementations§
§impl FFI_ArrowArray
impl FFI_ArrowArray
pub fn new(data: &ArrayData) -> FFI_ArrowArray
pub fn new(data: &ArrayData) -> FFI_ArrowArray
creates a new FFI_ArrowArray
from existing data.
pub unsafe fn from_raw(array: *mut FFI_ArrowArray) -> FFI_ArrowArray
pub unsafe fn from_raw(array: *mut FFI_ArrowArray) -> FFI_ArrowArray
Takes ownership of the pointed to FFI_ArrowArray
This acts to move the data out of array
, setting the release callback to NULL
§Safety
array
must be valid for reads and writesarray
must be properly alignedarray
must point to a properly initialized value ofFFI_ArrowArray
pub fn empty() -> FFI_ArrowArray
pub fn empty() -> FFI_ArrowArray
create an empty FFI_ArrowArray
, which can be used to import data into
pub fn is_released(&self) -> bool
pub fn is_released(&self) -> bool
Whether the array has been released
pub fn null_count(&self) -> usize
pub fn null_count(&self) -> usize
the null count of the array
pub 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 exceeds the number of buffers or the buffer is not correctly aligned
pub fn num_buffers(&self) -> usize
pub fn num_buffers(&self) -> usize
Returns the number of buffers
pub fn child(&self, index: usize) -> &FFI_ArrowArray
pub fn child(&self, index: usize) -> &FFI_ArrowArray
Returns the child at the provided index
pub fn num_children(&self) -> usize
pub fn num_children(&self) -> usize
Returns the number of children
pub fn dictionary(&self) -> Option<&FFI_ArrowArray>
pub fn dictionary(&self) -> Option<&FFI_ArrowArray>
Returns the dictionary if any
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FFI_ArrowArray
impl RefUnwindSafe for FFI_ArrowArray
impl Unpin for FFI_ArrowArray
impl UnwindSafe for FFI_ArrowArray
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more