Trait arrow::datatypes::ArrowPrimitiveType

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, bridging 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 Types§

type Native: ArrowNativeTypeOp

Corresponding Rust native type for the primitive type.

Required Associated Constants§

const DATA_TYPE: DataType

the corresponding Arrow data type of this primitive type.

Provided Methods§

fn get_byte_width() -> usize

👎Deprecated: Use ArrowNativeType::get_byte_width

Returns the byte width of this primitive type.

fn default_value() -> Self::Native

Returns a default value of this primitive type.

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

Object Safety§

This trait is not object safe.

Implementors§

§

impl ArrowPrimitiveType for Date32Type

§

type Native = i32

§

const DATA_TYPE: DataType = DataType::Date32

§

impl ArrowPrimitiveType for Date64Type

§

type Native = i64

§

const DATA_TYPE: DataType = DataType::Date64

§

impl ArrowPrimitiveType for Decimal128Type

§

type Native = i128

§

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

§

impl ArrowPrimitiveType for Decimal256Type

§

type Native = i256

§

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

§

impl ArrowPrimitiveType for DurationMicrosecondType

§

type Native = i64

§

const DATA_TYPE: DataType = _

§

impl ArrowPrimitiveType for DurationMillisecondType

§

type Native = i64

§

const DATA_TYPE: DataType = _

§

impl ArrowPrimitiveType for DurationNanosecondType

§

type Native = i64

§

const DATA_TYPE: DataType = _

§

impl ArrowPrimitiveType for DurationSecondType

§

type Native = i64

§

const DATA_TYPE: DataType = _

§

impl ArrowPrimitiveType for Float16Type

§

type Native = f16

§

const DATA_TYPE: DataType = DataType::Float16

§

impl ArrowPrimitiveType for Float32Type

§

type Native = f32

§

const DATA_TYPE: DataType = DataType::Float32

§

impl ArrowPrimitiveType for Float64Type

§

type Native = f64

§

const DATA_TYPE: DataType = DataType::Float64

§

impl ArrowPrimitiveType for Int8Type

§

type Native = i8

§

const DATA_TYPE: DataType = DataType::Int8

§

impl ArrowPrimitiveType for Int16Type

§

type Native = i16

§

const DATA_TYPE: DataType = DataType::Int16

§

impl ArrowPrimitiveType for Int32Type

§

type Native = i32

§

const DATA_TYPE: DataType = DataType::Int32

§

impl ArrowPrimitiveType for Int64Type

§

type Native = i64

§

const DATA_TYPE: DataType = DataType::Int64

§

impl ArrowPrimitiveType for IntervalDayTimeType

§

impl ArrowPrimitiveType for IntervalMonthDayNanoType

§

impl ArrowPrimitiveType for IntervalYearMonthType

§

type Native = i32

§

const DATA_TYPE: DataType = _

§

impl ArrowPrimitiveType for Time32MillisecondType

§

type Native = i32

§

const DATA_TYPE: DataType = _

§

impl ArrowPrimitiveType for Time32SecondType

§

type Native = i32

§

const DATA_TYPE: DataType = _

§

impl ArrowPrimitiveType for Time64MicrosecondType

§

type Native = i64

§

const DATA_TYPE: DataType = _

§

impl ArrowPrimitiveType for Time64NanosecondType

§

type Native = i64

§

const DATA_TYPE: DataType = _

§

impl ArrowPrimitiveType for TimestampMicrosecondType

§

type Native = i64

§

const DATA_TYPE: DataType = _

§

impl ArrowPrimitiveType for TimestampMillisecondType

§

type Native = i64

§

const DATA_TYPE: DataType = _

§

impl ArrowPrimitiveType for TimestampNanosecondType

§

type Native = i64

§

const DATA_TYPE: DataType = _

§

impl ArrowPrimitiveType for TimestampSecondType

§

type Native = i64

§

const DATA_TYPE: DataType = _

§

impl ArrowPrimitiveType for UInt8Type

§

type Native = u8

§

const DATA_TYPE: DataType = DataType::UInt8

§

impl ArrowPrimitiveType for UInt16Type

§

type Native = u16

§

const DATA_TYPE: DataType = DataType::UInt16

§

impl ArrowPrimitiveType for UInt32Type

§

type Native = u32

§

const DATA_TYPE: DataType = DataType::UInt32

§

impl ArrowPrimitiveType for UInt64Type

§

type Native = u64

§

const DATA_TYPE: DataType = DataType::UInt64