Skip to main content

PrimitiveVisitor

Trait PrimitiveVisitor 

Source
pub(crate) trait PrimitiveVisitor<T> {
    type Output;

    // Required methods
    fn slice(self, values: &[T]) -> Result<Self::Output>;
    fn map<S: Copy>(
        self,
        values: &[S],
        convert: impl Fn(S) -> T,
    ) -> Result<Self::Output>;
}
Expand description

Receives the values ArrowWriter stores for an Arrow array in an INT32 (T = i32) or INT64 (T = i64) column, which are also the values hashed into the column’s bloom filter

visit_i32 and visit_i64 hold the conversion from each Arrow type, and call Self::slice when the Arrow values are stored as they are, or Self::map when each value is converted. This lets the writer borrow the Arrow buffer when no conversion is needed.

Required Associated Types§

Required Methods§

Source

fn slice(self, values: &[T]) -> Result<Self::Output>

Receives values that are stored as they are

Source

fn map<S: Copy>( self, values: &[S], convert: impl Fn(S) -> T, ) -> Result<Self::Output>

Receives values that are each stored as convert(value)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T, E> PrimitiveVisitor<T> for WritePrimitive<'_, '_, E>
where E: ColumnValueEncoder<Values = [T]>,