pub struct TimestampArray { /* private fields */ }Expand description
Nanoseconds since the Unix epoch, timezone-less.
A nanosecond i64 column; see the module documentation.
Implementations§
Source§impl TimestampArray
impl TimestampArray
Sourcepub fn try_new(
values: ScalarBuffer<i64>,
validity: Option<Bitmap>,
) -> Result<Self>
pub fn try_new( values: ScalarBuffer<i64>, validity: Option<Bitmap>, ) -> Result<Self>
Builds an array from a values buffer and an optional validity bitmap.
§Errors
ValidityLengthMismatch
when the bitmap does not cover exactly one bit per value.
Sourcepub fn from_nanos(values: impl IntoIterator<Item = i64>) -> Self
pub fn from_nanos(values: impl IntoIterator<Item = i64>) -> Self
Builds an array with no nulls from nanosecond instants.
Sourcepub fn from_opt_nanos(values: impl IntoIterator<Item = Option<i64>>) -> Self
pub fn from_opt_nanos(values: impl IntoIterator<Item = Option<i64>>) -> Self
Builds an array from optional nanosecond instants.
Sourcepub fn values(&self) -> &[i64]
pub fn values(&self) -> &[i64]
The raw nanosecond values, including the placeholder in every null slot.
Sourcepub const fn values_buffer(&self) -> &ScalarBuffer<i64>
pub const fn values_buffer(&self) -> &ScalarBuffer<i64>
The values buffer.
Sourcepub fn value(&self, index: usize) -> Option<i64>
pub fn value(&self, index: usize) -> Option<i64>
The raw slot value at index, ignoring validity.
Returns None only when index is out of range.
Sourcepub fn get(&self, index: usize) -> Option<i64>
pub fn get(&self, index: usize) -> Option<i64>
The logical value at index: None when the slot is null or
out of range.
Sourcepub fn value_as_secs_f64(&self, index: usize) -> Option<f64>
pub fn value_as_secs_f64(&self, index: usize) -> Option<f64>
The value at index in seconds, as a float.
Lossy beyond 2^53 nanoseconds (about 104 days); use
Self::get when exactness matters.
Sourcepub fn value_as_duration(&self, index: usize) -> Option<Duration>
pub fn value_as_duration(&self, index: usize) -> Option<Duration>
The value at index as a std::time::Duration.
Returns None for a negative value, which Duration cannot
represent.
Sourcepub fn slice(&self, offset: usize, len: usize) -> Self
pub fn slice(&self, offset: usize, len: usize) -> Self
A zero-copy sub-range, clamped to the array (the crate-wide slicing convention).
Sourcepub fn with_validity(&self, validity: Option<Bitmap>) -> Result<Self>
pub fn with_validity(&self, validity: Option<Bitmap>) -> Result<Self>
Returns a copy with a different validity bitmap.
§Errors
ValidityLengthMismatch
when the bitmap length is wrong.
Sourcepub const fn as_primitive(&self) -> &Int64Array
pub const fn as_primitive(&self) -> &Int64Array
The underlying i64 column, keeping this type’s DataType.
Sourcepub fn from_primitive(values: &Int64Array) -> Result<Self>
pub fn from_primitive(values: &Int64Array) -> Result<Self>
Reinterprets a plain Int64 column as this temporal type.
Free: the two share a buffer layout.
§Errors
TypeMismatch when the
source is not an Int64, Timestamp or Duration column.
Trait Implementations§
Source§impl Array for TimestampArray
impl Array for TimestampArray
Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
ArrayExt::downcast.Source§fn validity(&self) -> Option<&Bitmap>
fn validity(&self) -> Option<&Bitmap>
None when every slot is valid. Read moreSource§fn buffer_memory_size(&self) -> usize
fn buffer_memory_size(&self) -> usize
Source§fn null_count(&self) -> usize
fn null_count(&self) -> usize
Source§impl<'a> ArrayAccessor for &'a TimestampArray
impl<'a> ArrayAccessor for &'a TimestampArray
Source§impl Clone for TimestampArray
impl Clone for TimestampArray
Source§impl Debug for TimestampArray
impl Debug for TimestampArray
impl Eq for TimestampArray
Source§impl FromIterator<Option<i64>> for TimestampArray
impl FromIterator<Option<i64>> for TimestampArray
Source§impl FromIterator<i64> for TimestampArray
impl FromIterator<i64> for TimestampArray
Source§impl<'a> IntoIterator for &'a TimestampArray
impl<'a> IntoIterator for &'a TimestampArray
Auto Trait Implementations§
impl !Freeze for TimestampArray
impl RefUnwindSafe for TimestampArray
impl Send for TimestampArray
impl Sync for TimestampArray
impl Unpin for TimestampArray
impl UnsafeUnpin for TimestampArray
impl UnwindSafe for TimestampArray
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<A> IntoArrayRef for Awhere
A: Array,
impl<A> IntoArrayRef for Awhere
A: Array,
Source§fn into_array_ref(self) -> ArrayRef
fn into_array_ref(self) -> ArrayRef
self into a shared, dynamically typed column.