Skip to main content

ToArrowArray

Trait ToArrowArray 

Source
pub trait ToArrowArray: Sized {
    // Required methods
    fn to_arrow_array(data: &[Self]) -> ArrowResult<ArrayRef>;
    fn arrow_data_type() -> DataType;
}
Expand description

Trait for types that can be converted to Arrow arrays

Implemented for primitive numeric types (f32, f64, i32, i64, etc.), boolean, and String types.

Required Methods§

Source

fn to_arrow_array(data: &[Self]) -> ArrowResult<ArrayRef>

Convert a slice of data to an Arrow array

Source

fn arrow_data_type() -> DataType

Get the Arrow DataType for this Rust type

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ToArrowArray for String

Source§

impl ToArrowArray for bool

Source§

impl ToArrowArray for f32

Source§

impl ToArrowArray for f64

Source§

impl ToArrowArray for i32

Source§

impl ToArrowArray for i64

Implementors§