pub struct TimeColumn { /* private fields */ }Implementations§
Source§impl TimeColumn
impl TimeColumn
Sourcepub fn builder(timeline: Timeline) -> TimeColumnBuilder
pub fn builder(timeline: Timeline) -> TimeColumnBuilder
Initializes a new TimeColumnBuilder.
Source§impl TimeColumn
impl TimeColumn
Sourcepub fn new(
is_sorted: Option<bool>,
timeline: Timeline,
times: ScalarBuffer<i64>,
) -> TimeColumn
pub fn new( is_sorted: Option<bool>, timeline: Timeline, times: ScalarBuffer<i64>, ) -> TimeColumn
Creates a new TimeColumn.
Iff you know for sure whether the data is already appropriately sorted or not, specify is_sorted.
When left unspecified (None), it will be computed in O(n) time.
For a row-oriented constructor, see Self::builder.
Sourcepub fn new_sequence(
name: impl Into<TimelineName>,
times: impl IntoIterator<Item = impl Into<i64>>,
) -> TimeColumn
pub fn new_sequence( name: impl Into<TimelineName>, times: impl IntoIterator<Item = impl Into<i64>>, ) -> TimeColumn
Creates a new TimeColumn of sequence type.
Sourcepub fn new_duration_secs(
name: impl Into<TimelineName>,
seconds: impl IntoIterator<Item = impl Into<f64>>,
) -> TimeColumn
pub fn new_duration_secs( name: impl Into<TimelineName>, seconds: impl IntoIterator<Item = impl Into<f64>>, ) -> TimeColumn
Creates a new TimeColumn of duration type, in seconds.
Sourcepub fn new_timestamp_secs_since_epoch(
name: impl Into<TimelineName>,
seconds: impl IntoIterator<Item = impl Into<f64>>,
) -> TimeColumn
pub fn new_timestamp_secs_since_epoch( name: impl Into<TimelineName>, seconds: impl IntoIterator<Item = impl Into<f64>>, ) -> TimeColumn
Creates a new TimeColumn of duration type, in seconds.
Sourcepub fn new_seconds(
name: impl Into<TimelineName>,
seconds: impl IntoIterator<Item = impl Into<f64>>,
) -> TimeColumn
👎Deprecated: Use TimeColumn::new_duration_secs or new_timestamp_secs_since_epoch instead
pub fn new_seconds( name: impl Into<TimelineName>, seconds: impl IntoIterator<Item = impl Into<f64>>, ) -> TimeColumn
TimeColumn::new_duration_secs or new_timestamp_secs_since_epoch insteadCreates a new TimeColumn of duration type, in seconds.
Sourcepub fn new_duration_nanos(
name: impl Into<TimelineName>,
nanos: impl IntoIterator<Item = impl Into<i64>>,
) -> TimeColumn
pub fn new_duration_nanos( name: impl Into<TimelineName>, nanos: impl IntoIterator<Item = impl Into<i64>>, ) -> TimeColumn
Creates a new TimeColumn measuring duration in nanoseconds.
Sourcepub fn new_timestamp_nanos_since_epoch(
name: impl Into<TimelineName>,
nanos: impl IntoIterator<Item = impl Into<i64>>,
) -> TimeColumn
pub fn new_timestamp_nanos_since_epoch( name: impl Into<TimelineName>, nanos: impl IntoIterator<Item = impl Into<i64>>, ) -> TimeColumn
Creates a new TimeColumn of timestamps, as nanoseconds since unix epoch.
Sourcepub fn new_nanos(
name: impl Into<TimelineName>,
nanos: impl IntoIterator<Item = impl Into<i64>>,
) -> TimeColumn
👎Deprecated: Use TimeColumn::new_duration_nanos or new_timestamp_nanos_since_epoch instead
pub fn new_nanos( name: impl Into<TimelineName>, nanos: impl IntoIterator<Item = impl Into<i64>>, ) -> TimeColumn
TimeColumn::new_duration_nanos or new_timestamp_nanos_since_epoch insteadCreates a new TimeColumn of nanoseconds type.
Sourcepub fn read_array(
array: &dyn Array,
) -> Result<ScalarBuffer<i64>, TimeColumnError>
pub fn read_array( array: &dyn Array, ) -> Result<ScalarBuffer<i64>, TimeColumnError>
Parse the given ArrowArray as a time column.
Results in an error if the array is of the wrong datatype, or if it contains nulls.
Sourcepub fn read_nullable_array(
array: &dyn Array,
) -> Result<(ScalarBuffer<i64>, Option<NullBuffer>), TimeColumnError>
pub fn read_nullable_array( array: &dyn Array, ) -> Result<(ScalarBuffer<i64>, Option<NullBuffer>), TimeColumnError>
Parse the given ArrowArray as a time column where null values are acceptable.
Results in an error if the array is of the wrong datatype.
Source§impl TimeColumn
impl TimeColumn
pub fn timeline(&self) -> &Timeline
pub fn name(&self) -> &str
pub fn time_range(&self) -> AbsoluteTimeRange
pub fn times_buffer(&self) -> &ScalarBuffer<i64>
Sourcepub fn times_array(&self) -> Arc<dyn Array>
pub fn times_array(&self) -> Arc<dyn Array>
Returns an array with the appropriate datatype.
Sourcepub fn times_raw(&self) -> &[i64]
pub fn times_raw(&self) -> &[i64]
All times in a time column are guaranteed not to have the value i64::MIN
(which is reserved for static data).
Sourcepub fn times_nonmin(&self) -> impl DoubleEndedIterator
pub fn times_nonmin(&self) -> impl DoubleEndedIterator
All times in a time column are guaranteed not to have the value i64::MIN
(which is reserved for static data).
pub fn times(&self) -> impl DoubleEndedIterator
pub fn num_rows(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn time_range_per_component(
&self,
components: &ChunkComponents,
) -> HashMap<ComponentDescriptor, AbsoluteTimeRange, BuildHasherDefault<NoHashHasher<ComponentDescriptor>>>
pub fn time_range_per_component( &self, components: &ChunkComponents, ) -> HashMap<ComponentDescriptor, AbsoluteTimeRange, BuildHasherDefault<NoHashHasher<ComponentDescriptor>>>
Computes the time range covered by each individual component column.
This is different from the time range covered by the TimeColumn as a whole
because component columns are potentially sparse.
This is crucial for indexing and queries to work properly.
Source§impl TimeColumn
impl TimeColumn
Sourcepub fn sanity_check(&self) -> Result<(), ChunkError>
pub fn sanity_check(&self) -> Result<(), ChunkError>
Returns an error if the Chunk’s invariants are not upheld.
Costly checks are only run in debug builds.
Source§impl TimeColumn
impl TimeColumn
Sourcepub fn concatenated(&self, rhs: &TimeColumn) -> Option<TimeColumn>
pub fn concatenated(&self, rhs: &TimeColumn) -> Option<TimeColumn>
Concatenates two TimeColumns into a new one.
The order of the arguments matter: self‘s contents will precede rhs’ contents in the
returned TimeColumn.
This will return None if the time chunks do not share the same timeline.
Source§impl TimeColumn
impl TimeColumn
Sourcepub fn is_sorted_uncached(&self) -> bool
pub fn is_sorted_uncached(&self) -> bool
Like Self::is_sorted, but actually checks the entire dataset rather than relying on the
cached value.
O(n). Useful for tests/debugging, or when you just don’t know.
See also Self::is_sorted.
Source§impl TimeColumn
impl TimeColumn
Sourcepub fn row_sliced(&self, index: usize, len: usize) -> TimeColumn
pub fn row_sliced(&self, index: usize, len: usize) -> TimeColumn
Slices the TimeColumn vertically.
The result is a new TimeColumn with the same timelines and (potentially) less rows.
This cannot fail nor panic: index and len will be capped so that they cannot
run out of bounds.
This can result in an empty TimeColumn being returned if the slice is completely OOB.
Sourcepub fn emptied(&self) -> TimeColumn
pub fn emptied(&self) -> TimeColumn
Empties the TimeColumn vertically.
The result is a new TimeColumn with the same columns but zero rows.
Trait Implementations§
Source§impl Clone for TimeColumn
impl Clone for TimeColumn
Source§fn clone(&self) -> TimeColumn
fn clone(&self) -> TimeColumn
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TimeColumn
impl Debug for TimeColumn
Source§impl PartialEq for TimeColumn
impl PartialEq for TimeColumn
Source§impl SizeBytes for TimeColumn
impl SizeBytes for TimeColumn
Source§fn heap_size_bytes(&self) -> u64
fn heap_size_bytes(&self) -> u64
self uses on the heap. Read moreSource§fn total_size_bytes(&self) -> u64
fn total_size_bytes(&self) -> u64
self in bytes, accounting for both stack and heap space.Source§fn stack_size_bytes(&self) -> u64
fn stack_size_bytes(&self) -> u64
self on the stack, in bytes. Read moreimpl Eq for TimeColumn
impl StructuralPartialEq for TimeColumn
Auto Trait Implementations§
impl Freeze for TimeColumn
impl RefUnwindSafe for TimeColumn
impl Send for TimeColumn
impl Sync for TimeColumn
impl Unpin for TimeColumn
impl UnwindSafe for TimeColumn
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.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> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.