Skip to main content

IntoArrowField

Trait IntoArrowField 

Source
pub trait IntoArrowField<'a> {
    // Required method
    fn into_arrow_field(self, data_type: &DataType) -> Cow<'a, Field>;
}
Expand description

The Arrow type description of an array being imported by ArrowSession::from_arrow_array.

Callers holding an Arrow Field (or FieldRef) should pass it: its ARROW:extension:name metadata is what dispatches the array to a registered ArrowImportVTable.

An Arrow array can carry a validity (null) buffer regardless of whether its schema declares the field nullable, so when no Field is in hand the caller passes the desired nullability instead, as a bool or a Nullability. An anonymous field is then synthesized from the array’s own data type, which means no extension plugin is dispatched for the array itself; fields nested inside container data types still carry their metadata and are routed through their importers.

Required Methods§

Source

fn into_arrow_field(self, data_type: &DataType) -> Cow<'a, Field>

Resolve to the Arrow Field describing an array of data_type.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<'a> IntoArrowField<'a> for &'a Field

Source§

fn into_arrow_field(self, _data_type: &DataType) -> Cow<'a, Field>

Source§

impl<'a> IntoArrowField<'a> for &'a FieldRef

Source§

fn into_arrow_field(self, _data_type: &DataType) -> Cow<'a, Field>

Source§

impl<'a> IntoArrowField<'a> for Nullability

Source§

fn into_arrow_field(self, data_type: &DataType) -> Cow<'a, Field>

Source§

impl<'a> IntoArrowField<'a> for bool

Source§

fn into_arrow_field(self, data_type: &DataType) -> Cow<'a, Field>

Implementors§