ScalarVector

Trait ScalarVector 

Source
pub trait ScalarVector:
    Vector
    + Send
    + Sync
    + Sized
    + 'static
where for<'a> Self::OwnedItem: Scalar<RefType<'a> = Self::RefItem<'a>>,
{ type OwnedItem: Scalar<VectorType = Self>; type RefItem<'a>: ScalarRef<'a, ScalarType = Self::OwnedItem> where Self: 'a; type Iter<'a>: Iterator<Item = Option<Self::RefItem<'a>>> where Self: 'a; type Builder: ScalarVectorBuilder<VectorType = Self>; // Required methods fn get_data(&self, idx: usize) -> Option<Self::RefItem<'_>>; fn iter_data(&self) -> Self::Iter<'_>; // Provided methods fn from_slice(data: &[Self::RefItem<'_>]) -> Self { ... } fn from_iterator<'a>(it: impl Iterator<Item = Self::RefItem<'a>>) -> Self { ... } fn from_owned_iterator( it: impl Iterator<Item = Option<Self::OwnedItem>>, ) -> Self { ... } fn from_vec<I: Into<Self::OwnedItem>>(values: Vec<I>) -> Self { ... } }
Expand description

A sub trait of Vector to add scalar operation support.

Required Associated Types§

Source

type OwnedItem: Scalar<VectorType = Self>

Source

type RefItem<'a>: ScalarRef<'a, ScalarType = Self::OwnedItem> where Self: 'a

The reference item of this vector.

Source

type Iter<'a>: Iterator<Item = Option<Self::RefItem<'a>>> where Self: 'a

Iterator type of this vector.

Source

type Builder: ScalarVectorBuilder<VectorType = Self>

Builder type to build this vector.

Required Methods§

Source

fn get_data(&self, idx: usize) -> Option<Self::RefItem<'_>>

Returns the reference to an element at given position.

Note: get() has bad performance, avoid call this function inside loop.

§Panics

Panics if idx >= self.len().

Source

fn iter_data(&self) -> Self::Iter<'_>

Returns iterator of current vector.

Provided Methods§

Source

fn from_slice(data: &[Self::RefItem<'_>]) -> Self

Source

fn from_iterator<'a>(it: impl Iterator<Item = Self::RefItem<'a>>) -> Self

Source

fn from_owned_iterator( it: impl Iterator<Item = Option<Self::OwnedItem>>, ) -> Self

Source

fn from_vec<I: Into<Self::OwnedItem>>(values: Vec<I>) -> Self

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 ScalarVector for BinaryVector

Source§

type OwnedItem = Vec<u8>

Source§

type RefItem<'a> = &'a [u8]

Source§

type Iter<'a> = ArrayIter<&'a GenericByteArray<GenericBinaryType<i32>>>

Source§

type Builder = BinaryVectorBuilder

Source§

impl ScalarVector for BooleanVector

Source§

type OwnedItem = bool

Source§

type RefItem<'a> = bool

Source§

type Iter<'a> = ArrayIter<&'a BooleanArray>

Source§

type Builder = BooleanVectorBuilder

Source§

impl ScalarVector for Decimal128Vector

Source§

type OwnedItem = Decimal128

Source§

type RefItem<'a> = Decimal128

Source§

type Iter<'a> = Decimal128Iter<'a>

Source§

type Builder = Decimal128VectorBuilder

Source§

impl ScalarVector for ListVector

Source§

impl ScalarVector for NullVector

Source§

impl ScalarVector for StringVector

Source§

type OwnedItem = String

Source§

type RefItem<'a> = &'a str

Source§

type Iter<'a> = ArrayIter<&'a GenericByteArray<GenericStringType<i32>>>

Source§

type Builder = StringVectorBuilder

Source§

impl ScalarVector for StructVector

Source§

impl<T: LogicalPrimitiveType> ScalarVector for PrimitiveVector<T>