Struct re_sdk::log::TimeColumn
source · pub struct TimeColumn {
pub(crate) timeline: Timeline,
pub(crate) times: ScalarBuffer<i64>,
pub(crate) is_sorted: bool,
pub(crate) time_range: ResolvedTimeRange,
}
Fields§
§timeline: Timeline
§times: ScalarBuffer<i64>
§is_sorted: bool
§time_range: ResolvedTimeRange
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_seconds(
name: impl Into<TimelineName>,
times: impl IntoIterator<Item = impl Into<f64>>,
) -> TimeColumn
pub fn new_seconds( name: impl Into<TimelineName>, times: impl IntoIterator<Item = impl Into<f64>>, ) -> TimeColumn
Creates a new TimeColumn
of sequence type.
sourcepub fn new_nanos(
name: impl Into<TimelineName>,
times: impl IntoIterator<Item = impl Into<i64>>,
) -> TimeColumn
pub fn new_nanos( name: impl Into<TimelineName>, times: impl IntoIterator<Item = impl Into<i64>>, ) -> TimeColumn
Creates 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) -> ResolvedTimeRange
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.
pub fn times_raw(&self) -> &[i64]
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<ComponentName, HashMap<ComponentDescriptor, ResolvedTimeRange, BuildHasherDefault<NoHashHasher<ComponentDescriptor>>>, BuildHasherDefault<NoHashHasher<ComponentName>>>
pub fn time_range_per_component( &self, components: &ChunkComponents, ) -> HashMap<ComponentName, HashMap<ComponentDescriptor, ResolvedTimeRange, BuildHasherDefault<NoHashHasher<ComponentDescriptor>>>, BuildHasherDefault<NoHashHasher<ComponentName>>>
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 TimeColumn
s 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§fn eq(&self, other: &TimeColumn) -> bool
fn eq(&self, other: &TimeColumn) -> bool
self
and other
values to be equal, and is used
by ==
.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 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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Conv for T
impl<T> Conv for T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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
.§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
.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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::Request
source§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)
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§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 more§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 more§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
§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
§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.§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.§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.§impl<T> Pointable for T
impl<T> Pointable for T
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
§impl<T> Tap for T
impl<T> Tap for T
§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 more§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 more§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 more§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 more§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 more§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 more§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.§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.§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.§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.§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.§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.§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.