Struct arrow2::array::PrimitiveArray [−][src]
pub struct PrimitiveArray<T: NativeType> { /* fields omitted */ }
Expand description
A PrimitiveArray
is arrow’s equivalent to Vec<Option<T: NativeType>>
, i.e.
an array designed for highly performant operations on optionally nullable slots,
backed by a physical type of a physical byte-width, such as i32
or f64
.
The size of this struct is O(1)
as all data is stored behind an std::sync::Arc
.
Implementations
Creates a new array out an iterator over values
Creates a new array out an iterator over values
Creates a new array out an iterator over values
Creates a new PrimitiveArray
from an iterator over values
Safety
The iterator must be TrustedLen
.
I.e. that size_hint().1
correctly reports its length.
Creates a new PrimitiveArray
from an iterator over optional values
Creates a new PrimitiveArray
from an iterator over optional values
Safety
The iterator must be TrustedLen
.
I.e. that size_hint().1
correctly reports its length.
pub fn iter(&'a self) -> ZipValidity<'a, &'a T, Iter<'a, T>>ⓘNotable traits for ZipValidity<'a, T, I>impl<'a, T, I: Iterator<Item = T>> Iterator for ZipValidity<'a, T, I> type Item = Option<T>;
pub fn iter(&'a self) -> ZipValidity<'a, &'a T, Iter<'a, T>>ⓘNotable traits for ZipValidity<'a, T, I>impl<'a, T, I: Iterator<Item = T>> Iterator for ZipValidity<'a, T, I> type Item = Option<T>;
impl<'a, T, I: Iterator<Item = T>> Iterator for ZipValidity<'a, T, I> type Item = Option<T>;
constructs a new iterator
Returns a new empty PrimitiveArray
.
Returns a new PrimitiveArray
whose all slots are null / None
.
The canonical method to create a PrimitiveArray
out of low-end APIs.
Panics
This function panics iff:
data_type
is not supported by the physical type- The validity is not
None
and its length is different from thevalues
’s length
Returns a slice of this PrimitiveArray
.
Implementation
This operation is O(1)
as it amounts to increase two ref counts.
Panic
This function panics iff offset + length >= self.len()
.
Safe method to retrieve the value at slot i
.
Equivalent to self.values()[i]
.
Returns a new PrimitiveArray
with a different logical type.
This is O(1)
.
Panics
Panics iff the data_type is not supported for the physical type.
Trait Implementations
The DataType
of the Array
. In combination with Array::as_any
, this can be
used to downcast trait objects (dyn Array
) to concrete arrays. Read more
impl<T> ArrayAdd<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + Add<Output = T> + NotI128,
impl<T> ArrayAdd<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + Add<Output = T> + NotI128,
impl<T> ArrayCheckedAdd<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + CheckedAdd<Output = T> + Zero + NotI128,
impl<T> ArrayCheckedAdd<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + CheckedAdd<Output = T> + Zero + NotI128,
type Output = Self
type Output = Self
impl<T> ArrayCheckedAdd<T> for PrimitiveArray<T> where
T: NativeType + CheckedAdd<Output = T> + Zero + NotI128,
impl<T> ArrayCheckedAdd<T> for PrimitiveArray<T> where
T: NativeType + CheckedAdd<Output = T> + Zero + NotI128,
impl<T> ArrayCheckedDiv<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + CheckedDiv<Output = T> + Zero + NotI128,
impl<T> ArrayCheckedDiv<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + CheckedDiv<Output = T> + Zero + NotI128,
type Output = Self
type Output = Self
impl<T> ArrayCheckedDiv<T> for PrimitiveArray<T> where
T: NativeType + CheckedDiv<Output = T> + Zero + NotI128,
impl<T> ArrayCheckedDiv<T> for PrimitiveArray<T> where
T: NativeType + CheckedDiv<Output = T> + Zero + NotI128,
impl<T> ArrayCheckedMul<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + CheckedMul<Output = T> + Zero + NotI128,
impl<T> ArrayCheckedMul<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + CheckedMul<Output = T> + Zero + NotI128,
type Output = Self
type Output = Self
impl<T> ArrayCheckedMul<T> for PrimitiveArray<T> where
T: NativeType + CheckedMul<Output = T> + Zero + NotI128,
impl<T> ArrayCheckedMul<T> for PrimitiveArray<T> where
T: NativeType + CheckedMul<Output = T> + Zero + NotI128,
impl<T> ArrayCheckedRem<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + CheckedRem<Output = T> + Zero + NotI128,
impl<T> ArrayCheckedRem<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + CheckedRem<Output = T> + Zero + NotI128,
type Output = Self
impl<T> ArrayCheckedRem<T> for PrimitiveArray<T> where
T: NativeType + CheckedRem<Output = T> + Zero + NotI128,
impl<T> ArrayCheckedRem<T> for PrimitiveArray<T> where
T: NativeType + CheckedRem<Output = T> + Zero + NotI128,
impl<T> ArrayCheckedSub<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + CheckedSub<Output = T> + Zero + NotI128,
impl<T> ArrayCheckedSub<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + CheckedSub<Output = T> + Zero + NotI128,
type Output = Self
type Output = Self
impl<T> ArrayCheckedSub<T> for PrimitiveArray<T> where
T: NativeType + CheckedSub<Output = T> + Zero + NotI128,
impl<T> ArrayCheckedSub<T> for PrimitiveArray<T> where
T: NativeType + CheckedSub<Output = T> + Zero + NotI128,
impl<T> ArrayDiv<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + Div<Output = T> + NotI128,
impl<T> ArrayDiv<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + Div<Output = T> + NotI128,
impl<T> ArrayMul<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + Mul<Output = T> + NotI128,
impl<T> ArrayMul<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + Mul<Output = T> + NotI128,
impl<T> ArrayOverflowingAdd<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + OverflowingAdd<Output = T> + NotI128,
impl<T> ArrayOverflowingAdd<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + OverflowingAdd<Output = T> + NotI128,
type Output = Self
impl<T> ArrayOverflowingAdd<T> for PrimitiveArray<T> where
T: NativeType + OverflowingAdd<Output = T> + NotI128,
impl<T> ArrayOverflowingAdd<T> for PrimitiveArray<T> where
T: NativeType + OverflowingAdd<Output = T> + NotI128,
impl<T> ArrayOverflowingMul<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + OverflowingMul<Output = T> + NotI128,
impl<T> ArrayOverflowingMul<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + OverflowingMul<Output = T> + NotI128,
type Output = Self
impl<T> ArrayOverflowingMul<T> for PrimitiveArray<T> where
T: NativeType + OverflowingMul<Output = T> + NotI128,
impl<T> ArrayOverflowingMul<T> for PrimitiveArray<T> where
T: NativeType + OverflowingMul<Output = T> + NotI128,
impl<T> ArrayOverflowingSub<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + OverflowingSub<Output = T>,
impl<T> ArrayOverflowingSub<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + OverflowingSub<Output = T>,
type Output = Self
impl<T> ArrayOverflowingSub<T> for PrimitiveArray<T> where
T: NativeType + OverflowingSub<Output = T> + NotI128,
impl<T> ArrayOverflowingSub<T> for PrimitiveArray<T> where
T: NativeType + OverflowingSub<Output = T> + NotI128,
impl<T> ArrayRem<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + Rem<Output = T> + NotI128,
impl<T> ArrayRem<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + Rem<Output = T> + NotI128,
impl<T> ArraySaturatingAdd<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + SaturatingAdd<Output = T> + NotI128,
impl<T> ArraySaturatingAdd<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + SaturatingAdd<Output = T> + NotI128,
type Output = Self
type Output = Self
impl<T> ArraySaturatingAdd<T> for PrimitiveArray<T> where
T: NativeType + SaturatingAdd<Output = T> + NotI128,
impl<T> ArraySaturatingAdd<T> for PrimitiveArray<T> where
T: NativeType + SaturatingAdd<Output = T> + NotI128,
impl<T> ArraySaturatingMul<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + SaturatingMul<Output = T> + NotI128,
impl<T> ArraySaturatingMul<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + SaturatingMul<Output = T> + NotI128,
type Output = Self
type Output = Self
impl<T> ArraySaturatingMul<T> for PrimitiveArray<T> where
T: NativeType + SaturatingMul<Output = T> + NotI128,
impl<T> ArraySaturatingMul<T> for PrimitiveArray<T> where
T: NativeType + SaturatingMul<Output = T> + NotI128,
impl<T> ArraySaturatingSub<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + SaturatingSub<Output = T> + NotI128,
impl<T> ArraySaturatingSub<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + SaturatingSub<Output = T> + NotI128,
type Output = Self
type Output = Self
impl<T> ArraySaturatingSub<T> for PrimitiveArray<T> where
T: NativeType + SaturatingSub<Output = T> + NotI128,
impl<T> ArraySaturatingSub<T> for PrimitiveArray<T> where
T: NativeType + SaturatingSub<Output = T> + NotI128,
impl<T> ArraySub<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + Sub<Output = T> + NotI128,
impl<T> ArraySub<PrimitiveArray<T>> for PrimitiveArray<T> where
T: NativeType + Sub<Output = T> + NotI128,
Performs the conversion.
Performs the conversion.
impl<T: NativeType + NaturalDataType, Ptr: Borrow<Option<T>>> FromIterator<Ptr> for PrimitiveArray<T>
impl<T: NativeType + NaturalDataType, Ptr: Borrow<Option<T>>> FromIterator<Ptr> for PrimitiveArray<T>
Creates a value from an iterator. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for PrimitiveArray<T> where
T: RefUnwindSafe,
impl<T> Send for PrimitiveArray<T>
impl<T> Sync for PrimitiveArray<T>
impl<T> Unpin for PrimitiveArray<T>
impl<T> UnwindSafe for PrimitiveArray<T> where
T: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more