pub struct TemporalArrayV {
pub array: TemporalArray,
pub offset: usize,
/* private fields */
}Expand description
§TemporalArrayView
Read-only, zero-copy view over a [offset .. offset + len) window of a
TemporalArray.
§Purpose
- Return an indexable subrange without cloning buffers.
- Optionally cache per-window null counts for faster repeated passes.
§Behaviour
- Supports 32-bit and 64-bit datetime storage behind
TemporalArray. - Provides upcast helpers -
get_i64andget_i32. - Further slicing yields another borrowed view.
§Fields
array: backingTemporalArray(enum over temporal types).offset: starting index into the backing array.len: logical number of elements in the view.null_count: cachedOption<usize>for this window (internal).
§Notes
- Not thread-safe due to
Cell. Create per-thread views withslice. - Use
to_temporal_arrayto materialise the window.
Fields§
§array: TemporalArrayThe outer array that this view is derived from - we retain a reference to it. Importantly, this is the full array - not the view, and thus should not be accessed as though it were the view subset.
offset: usizeThe index offset from 0 that for where this view starts from the outer array
Implementations§
Source§impl TemporalArrayV
impl TemporalArrayV
Sourcepub fn new(array: TemporalArray, offset: usize, len: usize) -> Self
pub fn new(array: TemporalArray, offset: usize, len: usize) -> Self
Creates a new TemporalArrayView with the given offset and length.
Sourcepub fn new_nc(
array: TemporalArray,
offset: usize,
len: usize,
null_count: usize,
) -> Self
pub fn new_nc( array: TemporalArray, offset: usize, len: usize, null_count: usize, ) -> Self
Creates a new TemporalArrayView with a precomputed null count.
Sourcepub fn get_i64(&self, i: usize) -> Option<i64>
pub fn get_i64(&self, i: usize) -> Option<i64>
Returns the value at logical index i within the window as i64 (upcasts i32 variant).
Sourcepub fn get_i32(&self, i: usize) -> Option<i32>
pub fn get_i32(&self, i: usize) -> Option<i32>
Returns the value at logical index i as i32 (None for Datetime64).
Sourcepub fn slice(&self, offset: usize, len: usize) -> Self
pub fn slice(&self, offset: usize, len: usize) -> Self
Returns a sliced TemporalArrayView from the current view.
Sourcepub fn inner_array(&self) -> Array
pub fn inner_array(&self) -> Array
Returns the full backing array wrapped as an Array enum, ignoring the view’s offset and length.
Use this to access inner array methods. The returned array is the unwindowed original.
Sourcepub fn to_temporal_array(&self) -> TemporalArray
pub fn to_temporal_array(&self) -> TemporalArray
Converts the view into an owned TemporalArray for the window.
If the view covers the entire backing array, returns a cheap Arc clone
of the original variant. Otherwise deep-copies the window via
slice_clone through inner_array.
Sourcepub fn as_tuple(&self) -> (TemporalArray, usize, usize)
pub fn as_tuple(&self) -> (TemporalArray, usize, usize)
Returns the view as a tuple (array, offset, len)
Sourcepub fn null_count(&self) -> usize
pub fn null_count(&self) -> usize
Returns the number of nulls in the view.
Sourcepub fn has_nulls(&self) -> bool
pub fn has_nulls(&self) -> bool
Returns true when the windowed view holds at least one null.
Reads through null_count, so the cached value is trusted when set
and the full popcount is only paid on the first call that observes
this view.
Sourcepub fn null_mask_view(&self) -> Option<BitmaskV>
pub fn null_mask_view(&self) -> Option<BitmaskV>
Returns the null mask as a windowed BitmaskView.
Trait Implementations§
Source§impl Clone for TemporalArrayV
impl Clone for TemporalArrayV
Source§fn clone(&self) -> TemporalArrayV
fn clone(&self) -> TemporalArrayV
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Concatenate for TemporalArrayV
impl Concatenate for TemporalArrayV
Source§fn concat(self, other: Self) -> Result<Self, MinarrowError>
fn concat(self, other: Self) -> Result<Self, MinarrowError>
Concatenates two temporal array views by materialising both to owned temporal arrays, concatenating them, and wrapping the result back in a view.
§Notes
- This operation copies data from both views to create owned temporal arrays.
- The resulting view has offset=0 and length equal to the combined length.
Source§impl DatetimeOps for TemporalArrayV
Available on crate feature datetime_ops only.
impl DatetimeOps for TemporalArrayV
datetime_ops only.Source§fn year(&self) -> IntegerArray<i32>
fn year(&self) -> IntegerArray<i32>
Source§fn month(&self) -> IntegerArray<i32>
fn month(&self) -> IntegerArray<i32>
Source§fn day(&self) -> IntegerArray<i32>
fn day(&self) -> IntegerArray<i32>
Source§fn hour(&self) -> IntegerArray<i32>
fn hour(&self) -> IntegerArray<i32>
Source§fn minute(&self) -> IntegerArray<i32>
fn minute(&self) -> IntegerArray<i32>
Source§fn second(&self) -> IntegerArray<i32>
fn second(&self) -> IntegerArray<i32>
Source§fn weekday(&self) -> IntegerArray<i32>
fn weekday(&self) -> IntegerArray<i32>
Source§fn day_of_year(&self) -> IntegerArray<i32>
fn day_of_year(&self) -> IntegerArray<i32>
Source§fn iso_week(&self) -> IntegerArray<i32>
fn iso_week(&self) -> IntegerArray<i32>
Source§fn quarter(&self) -> IntegerArray<i32>
fn quarter(&self) -> IntegerArray<i32>
Source§fn week_of_year(&self) -> IntegerArray<i32>
fn week_of_year(&self) -> IntegerArray<i32>
Source§fn is_leap_year(&self) -> BooleanArray<()>
fn is_leap_year(&self) -> BooleanArray<()>
Source§fn add_duration(&self, duration: Duration) -> Result<Self, MinarrowError>
fn add_duration(&self, duration: Duration) -> Result<Self, MinarrowError>
Source§fn sub_duration(&self, duration: Duration) -> Result<Self, MinarrowError>
fn sub_duration(&self, duration: Duration) -> Result<Self, MinarrowError>
Source§fn add_days(&self, days: i64) -> Result<Self, MinarrowError>
fn add_days(&self, days: i64) -> Result<Self, MinarrowError>
Source§fn add_months(&self, months: i32) -> Result<Self, MinarrowError>
fn add_months(&self, months: i32) -> Result<Self, MinarrowError>
Source§fn add_years(&self, years: i32) -> Result<Self, MinarrowError>
fn add_years(&self, years: i32) -> Result<Self, MinarrowError>
Source§fn diff(
&self,
other: &Self,
unit: TimeUnit,
) -> Result<IntegerArray<i64>, MinarrowError>
fn diff( &self, other: &Self, unit: TimeUnit, ) -> Result<IntegerArray<i64>, MinarrowError>
Source§fn abs_diff(
&self,
other: &Self,
unit: TimeUnit,
) -> Result<IntegerArray<i64>, MinarrowError>
fn abs_diff( &self, other: &Self, unit: TimeUnit, ) -> Result<IntegerArray<i64>, MinarrowError>
Source§fn is_before(&self, other: &Self) -> Result<BooleanArray<()>, MinarrowError>
fn is_before(&self, other: &Self) -> Result<BooleanArray<()>, MinarrowError>
self are before values in other.Source§fn is_after(&self, other: &Self) -> Result<BooleanArray<()>, MinarrowError>
fn is_after(&self, other: &Self) -> Result<BooleanArray<()>, MinarrowError>
other.Source§fn between(
&self,
start: &Self,
end: &Self,
) -> Result<BooleanArray<()>, MinarrowError>
fn between( &self, start: &Self, end: &Self, ) -> Result<BooleanArray<()>, MinarrowError>
Source§fn truncate(&self, unit: &str) -> Result<Self, MinarrowError>
fn truncate(&self, unit: &str) -> Result<Self, MinarrowError>
Source§fn cast_time_unit(&self, new_unit: TimeUnit) -> Result<Self, MinarrowError>
fn cast_time_unit(&self, new_unit: TimeUnit) -> Result<Self, MinarrowError>
Source§impl Debug for TemporalArrayV
impl Debug for TemporalArrayV
Source§impl Display for TemporalArrayV
impl Display for TemporalArrayV
Source§impl From<Array> for TemporalArrayV
impl From<Array> for TemporalArrayV
Source§impl From<ArrayV> for TemporalArrayV
impl From<ArrayV> for TemporalArrayV
Source§impl From<TemporalArray> for TemporalArrayV
impl From<TemporalArray> for TemporalArrayV
Source§fn from(array: TemporalArray) -> Self
fn from(array: TemporalArray) -> Self
Source§impl From<TemporalArrayV> for ArrayV
Available on crate features views and datetime only.TemporalArrayView -> ArrayView
impl From<TemporalArrayV> for ArrayV
views and datetime only.TemporalArrayView -> ArrayView
Converts by wrapping the inner TemporalArray as Array::TemporalArray.
Source§fn from(view: TemporalArrayV) -> Self
fn from(view: TemporalArrayV) -> Self
Source§impl From<TemporalArrayV> for Value
Available on crate features views and datetime only.Wrap a TemporalArrayV as Value::ArrayView. The view’s offset and length
are preserved; the inner TemporalArray flows through Array::TemporalArray.
impl From<TemporalArrayV> for Value
views and datetime only.Wrap a TemporalArrayV as Value::ArrayView. The view’s offset and length
are preserved; the inner TemporalArray flows through Array::TemporalArray.
Source§fn from(v: TemporalArrayV) -> Self
fn from(v: TemporalArrayV) -> Self
Source§impl PartialEq for TemporalArrayV
impl PartialEq for TemporalArrayV
Source§fn eq(&self, other: &TemporalArrayV) -> bool
fn eq(&self, other: &TemporalArrayV) -> bool
self and other values to be equal, and is used by ==.Source§impl Shape for TemporalArrayV
impl Shape for TemporalArrayV
Source§impl TryFrom<Value> for TemporalArrayV
Available on crate features views and datetime only.
impl TryFrom<Value> for TemporalArrayV
views and datetime only.impl StructuralPartialEq for TemporalArrayV
Auto Trait Implementations§
impl !Freeze for TemporalArrayV
impl RefUnwindSafe for TemporalArrayV
impl Send for TemporalArrayV
impl Sync for TemporalArrayV
impl Unpin for TemporalArrayV
impl UnsafeUnpin for TemporalArrayV
impl UnwindSafe for TemporalArrayV
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<T> CustomValue for T
impl<T> CustomValue for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Key for Twhere
T: Clone,
impl<T> Key for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more