Struct arrow::array::PrimitiveArray[][src]

pub struct PrimitiveArray<T: ArrowPrimitiveType> { /* fields omitted */ }

Array whose elements are of primitive types.

Implementations

impl<T: ArrowPrimitiveType> PrimitiveArray<T>[src]

pub fn len(&self) -> usize[src]

Returns the length of this array.

pub fn is_empty(&self) -> bool[src]

Returns whether this array is empty.

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

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Returns a slice of the values of this array

pub fn builder(capacity: usize) -> PrimitiveBuilder<T>[src]

pub unsafe fn value_unchecked(&self, i: usize) -> T::Native[src]

Returns the primitive value at index i.

Safety

caller must ensure that the passed in offset is less than the array len()

pub fn value(&self, i: usize) -> T::Native[src]

Returns the primitive value at index i.

Note this doesn’t do any bound checking, for performance reason.

Safety

caller must ensure that the passed in offset is less than the array len()

pub fn from_iter_values<I: IntoIterator<Item = T::Native>>(iter: I) -> Self[src]

Creates a PrimitiveArray based on an iterator of values without nulls

pub fn from_value(value: T::Native, count: usize) -> Self[src]

Creates a PrimitiveArray based on a constant value with count elements

impl<T: ArrowTemporalType + ArrowNumericType> PrimitiveArray<T> where
    i64: From<T::Native>, 
[src]

pub fn value_as_datetime(&self, i: usize) -> Option<NaiveDateTime>[src]

Returns value as a chrono NaiveDateTime, handling time resolution

If a data type cannot be converted to NaiveDateTime, a None is returned. A valid value is expected, thus the user should first check for validity.

pub fn value_as_date(&self, i: usize) -> Option<NaiveDate>[src]

Returns value as a chrono NaiveDate by using Self::datetime()

If a data type cannot be converted to NaiveDate, a None is returned

pub fn value_as_time(&self, i: usize) -> Option<NaiveTime>[src]

Returns a value as a chrono NaiveTime

Date32 and Date64 return UTC midnight as they do not have time resolution

pub fn value_as_duration(&self, i: usize) -> Option<Duration>[src]

Returns a value as a chrono Duration

If a data type cannot be converted to Duration, a None is returned

impl<'a, T: ArrowPrimitiveType> PrimitiveArray<T>[src]

pub fn iter(&'a self) -> PrimitiveIter<'a, T>

Notable traits for PrimitiveIter<'a, T>

impl<'a, T: ArrowPrimitiveType> Iterator for PrimitiveIter<'a, T> type Item = Option<T::Native>;
[src]

constructs a new iterator

impl<T: ArrowPrimitiveType> PrimitiveArray<T>[src]

pub unsafe fn from_trusted_len_iter<I, P>(iter: I) -> Self where
    P: Borrow<Option<<T as ArrowPrimitiveType>::Native>>,
    I: IntoIterator<Item = P>, 
[src]

Creates a PrimitiveArray from an iterator of trusted length.

Safety

The iterator must be TrustedLen. I.e. that size_hint().1 correctly reports its length.

impl<T: ArrowTimestampType> PrimitiveArray<T>[src]

pub fn from_vec(data: Vec<i64>, timezone: Option<String>) -> Self[src]

Construct a timestamp array from a vec of i64 values and an optional timezone

impl<T: ArrowTimestampType> PrimitiveArray<T>[src]

pub fn from_opt_vec(data: Vec<Option<i64>>, timezone: Option<String>) -> Self[src]

Construct a timestamp array from a vec of Option values and an optional timezone

Trait Implementations

impl<T: ArrowPrimitiveType> Array for PrimitiveArray<T>[src]

fn get_buffer_memory_size(&self) -> usize[src]

Returns the total number of bytes of memory occupied by the buffers owned by this PrimitiveArray.

fn get_array_memory_size(&self) -> usize[src]

Returns the total number of bytes of memory occupied physically by this PrimitiveArray.

impl<T: ArrowPrimitiveType> Debug for PrimitiveArray<T>[src]

impl<T: ArrowPrimitiveType> From<ArrayData> for PrimitiveArray<T>[src]

Constructs a PrimitiveArray from an array data reference.

impl From<Vec<<Date32Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Date32Type>[src]

impl From<Vec<<Date64Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Date64Type>[src]

impl From<Vec<<DurationMicrosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<DurationMicrosecondType>[src]

impl From<Vec<<DurationMillisecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<DurationMillisecondType>[src]

impl From<Vec<<DurationNanosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<DurationNanosecondType>[src]

impl From<Vec<<DurationSecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<DurationSecondType>[src]

impl From<Vec<<Float32Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Float32Type>[src]

impl From<Vec<<Float64Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Float64Type>[src]

impl From<Vec<<Int16Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Int16Type>[src]

impl From<Vec<<Int32Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Int32Type>[src]

impl From<Vec<<Int64Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Int64Type>[src]

impl From<Vec<<Int8Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Int8Type>[src]

impl From<Vec<<IntervalDayTimeType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<IntervalDayTimeType>[src]

impl From<Vec<<IntervalYearMonthType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<IntervalYearMonthType>[src]

impl From<Vec<<Time32MillisecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Time32MillisecondType>[src]

impl From<Vec<<Time32SecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Time32SecondType>[src]

impl From<Vec<<Time64MicrosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Time64MicrosecondType>[src]

impl From<Vec<<Time64NanosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Time64NanosecondType>[src]

impl From<Vec<<TimestampMicrosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<TimestampMicrosecondType>[src]

impl From<Vec<<TimestampMillisecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<TimestampMillisecondType>[src]

impl From<Vec<<TimestampNanosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<TimestampNanosecondType>[src]

impl From<Vec<<TimestampSecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<TimestampSecondType>[src]

impl From<Vec<<UInt16Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<UInt16Type>[src]

impl From<Vec<<UInt32Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<UInt32Type>[src]

impl From<Vec<<UInt64Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<UInt64Type>[src]

impl From<Vec<<UInt8Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<UInt8Type>[src]

impl From<Vec<Option<<Date32Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Date32Type>[src]

impl From<Vec<Option<<Date64Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Date64Type>[src]

impl From<Vec<Option<<DurationMicrosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<DurationMicrosecondType>[src]

impl From<Vec<Option<<DurationMillisecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<DurationMillisecondType>[src]

impl From<Vec<Option<<DurationNanosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<DurationNanosecondType>[src]

impl From<Vec<Option<<DurationSecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<DurationSecondType>[src]

impl From<Vec<Option<<Float32Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Float32Type>[src]

impl From<Vec<Option<<Float64Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Float64Type>[src]

impl From<Vec<Option<<Int16Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Int16Type>[src]

impl From<Vec<Option<<Int32Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Int32Type>[src]

impl From<Vec<Option<<Int64Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Int64Type>[src]

impl From<Vec<Option<<Int8Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Int8Type>[src]

impl From<Vec<Option<<IntervalDayTimeType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<IntervalDayTimeType>[src]

impl From<Vec<Option<<IntervalYearMonthType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<IntervalYearMonthType>[src]

impl From<Vec<Option<<Time32MillisecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Time32MillisecondType>[src]

impl From<Vec<Option<<Time32SecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Time32SecondType>[src]

impl From<Vec<Option<<Time64MicrosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Time64MicrosecondType>[src]

impl From<Vec<Option<<Time64NanosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Time64NanosecondType>[src]

impl From<Vec<Option<<TimestampMicrosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<TimestampMicrosecondType>[src]

impl From<Vec<Option<<TimestampMillisecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<TimestampMillisecondType>[src]

impl From<Vec<Option<<TimestampNanosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<TimestampNanosecondType>[src]

impl From<Vec<Option<<TimestampSecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<TimestampSecondType>[src]

impl From<Vec<Option<<UInt16Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<UInt16Type>[src]

impl From<Vec<Option<<UInt32Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<UInt32Type>[src]

impl From<Vec<Option<<UInt64Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<UInt64Type>[src]

impl From<Vec<Option<<UInt8Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<UInt8Type>[src]

impl<T: ArrowPrimitiveType, Ptr: Borrow<Option<<T as ArrowPrimitiveType>::Native>>> FromIterator<Ptr> for PrimitiveArray<T>[src]

impl<'a, T: ArrowPrimitiveType> IntoIterator for &'a PrimitiveArray<T>[src]

type Item = Option<<T as ArrowPrimitiveType>::Native>

The type of the elements being iterated over.

type IntoIter = PrimitiveIter<'a, T>

Which kind of iterator are we turning this into?

impl<T: ArrowPrimitiveType> JsonEqual for PrimitiveArray<T>[src]

Implement array equals for numeric type

impl<T: ArrowPrimitiveType> PartialEq<PrimitiveArray<T>> for PrimitiveArray<T>[src]

impl<T: ArrowPrimitiveType> PartialEq<Value> for PrimitiveArray<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for PrimitiveArray<T> where
    <T as ArrowPrimitiveType>::Native: 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 as ArrowPrimitiveType>::Native: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,