Skip to main content

FFI_ArrowArray

Struct FFI_ArrowArray 

Source
#[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: i64

Logical length of the array

§null_count: i64

Number of null items in the array

§offset: i64

logical offset inside the array

§n_buffers: i64

Number of physical buffers backing this array

§n_children: i64

Number of children this array has

§buffers: *mut *const c_void

C array of pointers to the start of each physical buffer backing this array

§children: *mut *mut FFI_ArrowArray

C array of pointers to each child array of this array

§dictionary: *mut FFI_ArrowArray

Pointer 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_void

Opaque 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

Source

pub fn new(data: &ArrayData) -> Self

creates a new FFI_ArrowArray from existing data.

Source

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
  • array must be valid for reads and writes
  • array must be properly aligned
  • array must point to a properly initialized value of FFI_ArrowArray
Source

pub fn empty() -> Self

create an empty FFI_ArrowArray, which can be used to import data into

Source

pub fn len(&self) -> usize

the length of the array

Source

pub fn is_empty(&self) -> bool

whether the array is empty

Source

pub fn is_released(&self) -> bool

Whether the array has been released

Source

pub fn offset(&self) -> usize

the offset of the array

Source

pub fn null_count(&self) -> usize

the null count of the array

Source

pub fn null_count_opt(&self) -> Option<usize>

Returns the null count, checking for validity

Source

pub unsafe fn set_null_count(&mut self, null_count: i64)

Set the null count of the array

§Safety

Null count must match that of null buffer

Source

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

Source

pub fn num_buffers(&self) -> usize

Returns the number of buffers

Source

pub fn child(&self, index: usize) -> &FFI_ArrowArray

Returns the child at the provided index

Source

pub fn num_children(&self) -> usize

Returns the number of children

Source

pub fn dictionary(&self) -> Option<&Self>

Returns the dictionary if any

Trait Implementations§

Source§

impl Debug for FFI_ArrowArray

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for FFI_ArrowArray

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for FFI_ArrowArray

Source§

impl Sync for FFI_ArrowArray

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,