Module arrow_extendr::to

source ·
Expand description

Convert arrow-rs structs into an Robj

The traits ToArrowRobj and IntoArrowRobj provide the methods to_arrow_robj() and into_arrow_robj() respectively. The former takes a reference to self whereas the latter consumes self.

Prefer to_arrow_robj() for all structs except ArrowArrayStreamReader.

fn array_to_robj() -> Result<Robj> {
    let array = Int32Array::from(vec![Some(1), None, Some(3)]);
    array.to_arrow_robj()
}
arrow-rs structR object
ArrayDatananoarrow_array
PrimitiveArray<T>nanoarrow_array
Fieldnanoarrow_schema
DataTypenanoarrow_schema
Schemananoarrow_schema
RecordBatchnanoarrow_array_stream
ArrowArrayStreamReadernanoarrow_array_stream

Traits

Functions