Struct arrow_data::ffi::FFI_ArrowArray

source ·
#[repr(C)]
pub struct FFI_ArrowArray { /* private fields */ }
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)
}

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

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>,

§

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>,

§

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.
source§

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