Skip to main content

FloatArray

Trait FloatArray 

Source
pub trait FloatArray<T: ArrowFloatType + ?Sized>:
    Array
    + Clone
    + 'static {
    type FloatType: ArrowFloatType;

    // Required methods
    fn as_slice(&self) -> &[T::Native];
    fn from_values(values: Vec<T::Native>) -> Self;

    // Provided method
    fn from_iter_values(values: impl IntoIterator<Item = T::Native>) -> Self
       where Self: Sized { ... }
}
Expand description

FloatArray is a trait that is implemented by all float type arrays

This is similar to arrow_array::PrimitiveArray but applies to all float types (including bfloat16) and is implemented as a trait and not a struct

Required Associated Types§

Required Methods§

Source

fn as_slice(&self) -> &[T::Native]

Returns a reference to the underlying data as a slice.

Source

fn from_values(values: Vec<T::Native>) -> Self

Construct an array from a vector of values.

Provided Methods§

Source

fn from_iter_values(values: impl IntoIterator<Item = T::Native>) -> Self
where Self: Sized,

Construct an array from an iterator of values.

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 FloatArray<BFloat16Type> for FixedSizeBinaryArray

Source§

impl FloatArray<Float16Type> for Float16Array

Source§

impl FloatArray<Float32Type> for Float32Array

Source§

impl FloatArray<Float64Type> for Float64Array

Implementors§