arrow_array::types

Trait ArrowPrimitiveType

Source
pub trait ArrowPrimitiveType: PrimitiveTypeSealed + 'static {
    type Native: ArrowNativeTypeOp;

    const DATA_TYPE: DataType;

    // Provided methods
    fn get_byte_width() -> usize { ... }
    fn default_value() -> Self::Native { ... }
}
Expand description

Trait for primitive values.

This trait bridges the dynamic-typed nature of Arrow (via DataType) with the static-typed nature of rust types (ArrowNativeType) for all types that implement ArrowNativeType.

Required Associated Constants§

Source

const DATA_TYPE: DataType

the corresponding Arrow data type of this primitive type.

Required Associated Types§

Source

type Native: ArrowNativeTypeOp

Corresponding Rust native type for the primitive type.

Provided Methods§

Source

fn get_byte_width() -> usize

👎Deprecated: Use ArrowNativeType::get_byte_width

Returns the byte width of this primitive type.

Source

fn default_value() -> Self::Native

Returns a default value of this primitive type.

This is useful for aggregate array ops like sum(), mean().

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl ArrowPrimitiveType for Date32Type

Source§

const DATA_TYPE: DataType = DataType::Date32

Source§

type Native = i32

Source§

impl ArrowPrimitiveType for Date64Type

Source§

const DATA_TYPE: DataType = DataType::Date64

Source§

type Native = i64

Source§

impl ArrowPrimitiveType for Decimal128Type

Source§

const DATA_TYPE: DataType = <Self as DecimalType>::DEFAULT_TYPE

Source§

type Native = i128

Source§

impl ArrowPrimitiveType for Decimal256Type

Source§

const DATA_TYPE: DataType = <Self as DecimalType>::DEFAULT_TYPE

Source§

type Native = i256

Source§

impl ArrowPrimitiveType for DurationMicrosecondType

Source§

impl ArrowPrimitiveType for DurationMillisecondType

Source§

impl ArrowPrimitiveType for DurationNanosecondType

Source§

impl ArrowPrimitiveType for DurationSecondType

Source§

impl ArrowPrimitiveType for Float16Type

Source§

const DATA_TYPE: DataType = DataType::Float16

Source§

type Native = f16

Source§

impl ArrowPrimitiveType for Float32Type

Source§

const DATA_TYPE: DataType = DataType::Float32

Source§

type Native = f32

Source§

impl ArrowPrimitiveType for Float64Type

Source§

const DATA_TYPE: DataType = DataType::Float64

Source§

type Native = f64

Source§

impl ArrowPrimitiveType for Int8Type

Source§

const DATA_TYPE: DataType = DataType::Int8

Source§

type Native = i8

Source§

impl ArrowPrimitiveType for Int16Type

Source§

const DATA_TYPE: DataType = DataType::Int16

Source§

type Native = i16

Source§

impl ArrowPrimitiveType for Int32Type

Source§

const DATA_TYPE: DataType = DataType::Int32

Source§

type Native = i32

Source§

impl ArrowPrimitiveType for Int64Type

Source§

const DATA_TYPE: DataType = DataType::Int64

Source§

type Native = i64

Source§

impl ArrowPrimitiveType for IntervalDayTimeType

Source§

impl ArrowPrimitiveType for IntervalMonthDayNanoType

Source§

impl ArrowPrimitiveType for IntervalYearMonthType

Source§

impl ArrowPrimitiveType for Time32MillisecondType

Source§

impl ArrowPrimitiveType for Time32SecondType

Source§

impl ArrowPrimitiveType for Time64MicrosecondType

Source§

impl ArrowPrimitiveType for Time64NanosecondType

Source§

impl ArrowPrimitiveType for TimestampMicrosecondType

Source§

impl ArrowPrimitiveType for TimestampMillisecondType

Source§

impl ArrowPrimitiveType for TimestampNanosecondType

Source§

impl ArrowPrimitiveType for TimestampSecondType

Source§

impl ArrowPrimitiveType for UInt8Type

Source§

const DATA_TYPE: DataType = DataType::UInt8

Source§

type Native = u8

Source§

impl ArrowPrimitiveType for UInt16Type

Source§

const DATA_TYPE: DataType = DataType::UInt16

Source§

type Native = u16

Source§

impl ArrowPrimitiveType for UInt32Type

Source§

const DATA_TYPE: DataType = DataType::UInt32

Source§

type Native = u32

Source§

impl ArrowPrimitiveType for UInt64Type

Source§

const DATA_TYPE: DataType = DataType::UInt64

Source§

type Native = u64