#[repr(C)]pub struct ArrowArray {
pub length: i64,
pub null_count: i64,
pub offset: i64,
pub n_buffers: i64,
pub n_children: i64,
pub buffers: *mut *const u8,
pub children: *mut *mut ArrowArray,
pub dictionary: *mut ArrowArray,
pub release: Option<unsafe extern "C" fn(*mut ArrowArray)>,
pub private_data: *mut c_void,
}Expand description
ArrowArray as per the Arrow C spec
- Box::new(ArrowArray::empty()) - allocates ~80 bytes for the metadata struct
- PyArrow’s _export_to_c fills in the struct, setting buffers to point to PyArrow’s memory
- ForeignBuffer stores this Box and uses the buffers pointer for zero-copy access
- The data never moves - we just hold a pointer to it
Fields§
§length: i64§null_count: i64§offset: i64§n_buffers: i64§n_children: i64§buffers: *mut *const u8§children: *mut *mut ArrowArray§dictionary: *mut ArrowArray§release: Option<unsafe extern "C" fn(*mut ArrowArray)>§private_data: *mut c_voidImplementations§
Source§impl ArrowArray
impl ArrowArray
Sourcepub fn empty() -> ArrowArray
pub fn empty() -> ArrowArray
Creates an empty ArrowArray for receiving FFI data. Used when importing from external sources (e.g., PyArrow).
Auto Trait Implementations§
impl !Send for ArrowArray
impl !Sync for ArrowArray
impl Freeze for ArrowArray
impl RefUnwindSafe for ArrowArray
impl Unpin for ArrowArray
impl UnsafeUnpin for ArrowArray
impl UnwindSafe for 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