Struct arrow::ffi::ArrowArray [−][src]
pub struct ArrowArray { /* fields omitted */ }
Struct used to move an Array from and to the C Data Interface. Its main responsibility is to expose functionality that requires both FFI_ArrowArray and FFI_ArrowSchema.
This struct has two main paths:
Import from the C Data Interface
- ArrowArray::empty to allocate memory to be filled by an external call
- ArrowArray::try_from_raw to consume two non-null allocated pointers
Export to the C Data Interface
- ArrowArray::try_new to create a new ArrowArray from Rust-specific information
- ArrowArray::into_raw to expose two pointers for FFI_ArrowArray and FFI_ArrowSchema.
Safety
Whoever creates this struct is responsible for releasing their resources. Specifically, consumers must call ArrowArray::into_raw and take ownership of the individual pointers, calling FFI_ArrowArray::release and FFI_ArrowSchema::release accordingly.
Furthermore, this struct assumes that the incoming data agrees with the C data interface.
Implementations
impl ArrowArray
[src]
impl ArrowArray
[src]pub unsafe fn try_new(
data_type: &DataType,
len: usize,
null_count: usize,
null_buffer: Option<Buffer>,
offset: usize,
buffers: Vec<Buffer>,
child_data: Vec<ArrowArray>,
nullable: bool
) -> Result<Self>
[src]
data_type: &DataType,
len: usize,
null_count: usize,
null_buffer: Option<Buffer>,
offset: usize,
buffers: Vec<Buffer>,
child_data: Vec<ArrowArray>,
nullable: bool
) -> Result<Self>
creates a new ArrowArray
. This is used to export to the C Data Interface.
Safety
See safety of ArrowArray
pub unsafe fn try_from_raw(
array: *const FFI_ArrowArray,
schema: *const FFI_ArrowSchema
) -> Result<Self>
[src]
array: *const FFI_ArrowArray,
schema: *const FFI_ArrowSchema
) -> Result<Self>
creates a new ArrowArray from two pointers. Used to import from the C Data Interface.
Safety
See safety of ArrowArray
Error
Errors if any of the pointers is null
pub unsafe fn empty() -> Self
[src]
creates a new empty ArrowArray. Used to import from the C Data Interface.
Safety
See safety of ArrowArray
pub fn into_raw(
this: ArrowArray
) -> (*const FFI_ArrowArray, *const FFI_ArrowSchema)
[src]
this: ArrowArray
) -> (*const FFI_ArrowArray, *const FFI_ArrowSchema)
exports ArrowArray to the C Data Interface
pub fn null_bit_buffer(&self) -> Option<Buffer>
[src]
returns the null bit buffer. Rust implementation uses a buffer that is not part of the array of buffers. The C Data interface’s null buffer is part of the array of buffers.
pub fn buffers(&self) -> Result<Vec<Buffer>>
[src]
returns all buffers, as organized by Rust (i.e. null buffer is skipped)
pub fn children(&self) -> Result<Vec<ArrayData>>
[src]
returns the child data of this array
pub fn len(&self) -> usize
[src]
the length of the array
pub fn is_empty(&self) -> bool
[src]
whether the array is empty
pub fn offset(&self) -> usize
[src]
the offset of the array
pub fn null_count(&self) -> usize
[src]
the null count of the array
pub fn data_type(&self, child_type: Option<DataType>) -> Result<DataType>
[src]
the data_type as declared in the schema
Trait Implementations
impl TryFrom<ArrayData> for ArrowArray
[src]
impl TryFrom<ArrayData> for ArrowArray
[src]impl TryFrom<ArrowArray> for ArrayData
[src]
impl TryFrom<ArrowArray> for ArrayData
[src]type Error = ArrowError
The type returned in the event of a conversion error.
fn try_from(value: ArrowArray) -> Result<Self>
[src]
Auto Trait Implementations
impl RefUnwindSafe for ArrowArray
impl RefUnwindSafe for ArrowArray
impl !Send for ArrowArray
impl !Send for ArrowArray
impl !Sync for ArrowArray
impl !Sync for ArrowArray
impl Unpin for ArrowArray
impl Unpin for ArrowArray
impl UnwindSafe for ArrowArray
impl UnwindSafe for ArrowArray