lance_arrow::floats

Trait ArrowFloatType

Source
pub trait ArrowFloatType: Debug {
    type Native: FromPrimitive + FloatToArrayType<ArrowType = Self> + AsPrimitive<f32> + Debug + Display;
    type ArrayType: FloatArray<Self>;

    const FLOAT_TYPE: FloatType;
    const MIN: Self::Native;
    const MAX: Self::Native;

    // Provided method
    fn empty_array() -> Self::ArrayType { ... }
}
Expand description

Trait for float types used in Arrow Array.

Required Associated Constants§

Required Associated Types§

Source

type Native: FromPrimitive + FloatToArrayType<ArrowType = Self> + AsPrimitive<f32> + Debug + Display

Source

type ArrayType: FloatArray<Self>

Arrow Float Array Type.

Provided Methods§

Source

fn empty_array() -> Self::ArrayType

Returns empty array of this 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.

Implementations on Foreign Types§

Source§

impl ArrowFloatType for Float16Type

Source§

const FLOAT_TYPE: FloatType = FloatType::Float16

Source§

const MIN: Self::Native = {transmute(0xfbff): <arrow_array::types::Float16Type as floats::ArrowFloatType>::Native}

Source§

const MAX: Self::Native = {transmute(0x7bff): <arrow_array::types::Float16Type as floats::ArrowFloatType>::Native}

Source§

type Native = f16

Source§

type ArrayType = PrimitiveArray<Float16Type>

Source§

impl ArrowFloatType for Float32Type

Source§

const FLOAT_TYPE: FloatType = FloatType::Float32

Source§

const MIN: Self::Native = {transmute(0xff7fffff): <arrow_array::types::Float32Type as floats::ArrowFloatType>::Native}

Source§

const MAX: Self::Native = {transmute(0x7f7fffff): <arrow_array::types::Float32Type as floats::ArrowFloatType>::Native}

Source§

type Native = f32

Source§

type ArrayType = PrimitiveArray<Float32Type>

Source§

impl ArrowFloatType for Float64Type

Source§

const FLOAT_TYPE: FloatType = FloatType::Float64

Source§

const MIN: Self::Native = {transmute(0xffefffffffffffff): <arrow_array::types::Float64Type as floats::ArrowFloatType>::Native}

Source§

const MAX: Self::Native = {transmute(0x7fefffffffffffff): <arrow_array::types::Float64Type as floats::ArrowFloatType>::Native}

Source§

type Native = f64

Source§

type ArrayType = PrimitiveArray<Float64Type>

Implementors§

Source§

impl ArrowFloatType for BFloat16Type

Source§

const FLOAT_TYPE: FloatType = FloatType::BFloat16

Source§

const MIN: Self::Native = {transmute(0xff7f): <bfloat16::BFloat16Type as floats::ArrowFloatType>::Native}

Source§

const MAX: Self::Native = {transmute(0x7f7f): <bfloat16::BFloat16Type as floats::ArrowFloatType>::Native}

Source§

type Native = bf16

Source§

type ArrayType = BFloat16Array