datatypes::types::primitive_type

Trait LogicalPrimitiveType

Source
pub trait LogicalPrimitiveType: 'static + Sized {
    type ArrowPrimitive: ArrowPrimitiveType<Native = Self::Native>;
    type Native: ArrowNativeType;
    type Wrapper: WrapperType<LogicalType = Self, Native = Self::Native> + for<'a> Scalar<VectorType = PrimitiveVector<Self>, RefType<'a> = Self::Wrapper> + for<'a> ScalarRef<'a, ScalarType = Self::Wrapper>;
    type LargestType: LogicalPrimitiveType;

    // Required methods
    fn build_data_type() -> ConcreteDataType;
    fn type_name() -> &'static str;
    fn cast_vector(vector: &dyn Vector) -> Result<&PrimitiveVector<Self>>;
    fn cast_value_ref(value: ValueRef<'_>) -> Result<Option<Self::Wrapper>>;
}
Expand description

Trait bridging the logical primitive type with [ArrowPrimitiveType].

Required Associated Types§

Source

type ArrowPrimitive: ArrowPrimitiveType<Native = Self::Native>

Arrow primitive type of this logical type.

Source

type Native: ArrowNativeType

Native (physical) type of this logical type.

Source

type Wrapper: WrapperType<LogicalType = Self, Native = Self::Native> + for<'a> Scalar<VectorType = PrimitiveVector<Self>, RefType<'a> = Self::Wrapper> + for<'a> ScalarRef<'a, ScalarType = Self::Wrapper>

Wrapper type that the vector returns.

Source

type LargestType: LogicalPrimitiveType

Largest type this primitive type can cast to.

Required Methods§

Source

fn build_data_type() -> ConcreteDataType

Construct the data type struct.

Source

fn type_name() -> &'static str

Return the name of the type.

Source

fn cast_vector(vector: &dyn Vector) -> Result<&PrimitiveVector<Self>>

Dynamic cast the vector to the concrete vector type.

Source

fn cast_value_ref(value: ValueRef<'_>) -> Result<Option<Self::Wrapper>>

Cast value ref to the primitive type.

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 LogicalPrimitiveType for DateType

Source§

impl LogicalPrimitiveType for DateTimeType

Source§

impl LogicalPrimitiveType for DurationMicrosecondType

Source§

impl LogicalPrimitiveType for DurationMillisecondType

Source§

impl LogicalPrimitiveType for DurationNanosecondType

Source§

impl LogicalPrimitiveType for DurationSecondType

Source§

impl LogicalPrimitiveType for IntervalDayTimeType

Source§

type ArrowPrimitive = IntervalDayTimeType

Source§

type Native = IntervalDayTime

Source§

type Wrapper = IntervalDayTime

Source§

type LargestType = IntervalDayTimeType

Source§

impl LogicalPrimitiveType for IntervalMonthDayNanoType

Source§

type ArrowPrimitive = IntervalMonthDayNanoType

Source§

type Native = IntervalMonthDayNano

Source§

type Wrapper = IntervalMonthDayNano

Source§

type LargestType = IntervalMonthDayNanoType

Source§

impl LogicalPrimitiveType for IntervalYearMonthType

Source§

type ArrowPrimitive = IntervalYearMonthType

Source§

type Native = i32

Source§

type Wrapper = IntervalYearMonth

Source§

type LargestType = IntervalYearMonthType

Source§

impl LogicalPrimitiveType for TimeMicrosecondType

Source§

impl LogicalPrimitiveType for TimeMillisecondType

Source§

impl LogicalPrimitiveType for TimeNanosecondType

Source§

impl LogicalPrimitiveType for TimeSecondType

Source§

impl LogicalPrimitiveType for TimestampMicrosecondType

Source§

impl LogicalPrimitiveType for TimestampMillisecondType

Source§

impl LogicalPrimitiveType for TimestampNanosecondType

Source§

impl LogicalPrimitiveType for TimestampSecondType

Source§

impl LogicalPrimitiveType for Float32Type

Source§

impl LogicalPrimitiveType for Float64Type

Source§

impl LogicalPrimitiveType for Int8Type

Source§

impl LogicalPrimitiveType for Int16Type

Source§

impl LogicalPrimitiveType for Int32Type

Source§

impl LogicalPrimitiveType for Int64Type

Source§

impl LogicalPrimitiveType for UInt8Type

Source§

impl LogicalPrimitiveType for UInt16Type

Source§

impl LogicalPrimitiveType for UInt32Type

Source§

impl LogicalPrimitiveType for UInt64Type