Struct rerun::sdk::prelude::TimeColumn
source · pub struct TimeColumn {
pub(crate) timeline: Timeline,
pub(crate) times: PrimitiveArray<i64>,
pub(crate) is_sorted: bool,
pub(crate) time_range: ResolvedTimeRange,
}
Fields§
§timeline: Timeline
§times: PrimitiveArray<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: PrimitiveArray<i64>
) -> TimeColumn
pub fn new( is_sorted: Option<bool>, timeline: Timeline, times: PrimitiveArray<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.
source§impl TimeColumn
impl TimeColumn
pub fn timeline(&self) -> &Timeline
pub fn name(&self) -> &str
pub fn time_range(&self) -> ResolvedTimeRange
pub fn times_array(&self) -> &PrimitiveArray<i64>
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: &BTreeMap<ComponentName, ListArray<i32>>
) -> BTreeMap<ComponentName, ResolvedTimeRange>
pub fn time_range_per_component( &self, components: &BTreeMap<ComponentName, ListArray<i32>> ) -> BTreeMap<ComponentName, ResolvedTimeRange>
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
on the heap, in bytes.source§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>
§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