Struct re_viewer::external::re_chunk_store::RowId
source · pub struct RowId(pub(crate) Tuid);
Expand description
A unique ID for a row’s worth of data within a chunk.
There is no relationship whatsoever between a ChunkId
and the RowId
s within that chunk.
§Uniqueness
Duplicated RowId
s within a single recording is considered undefined behavior.
While it is benign in most cases, care has to be taken when manually crafting RowId
s.
Ideally: don’t do so and stick to RowId::new
instead to avoid bad surprises.
This makes it easy to build and maintain secondary indices around RowId
s with few to no
extraneous state tracking.
§Query
Queries (both latest-at & range semantics) will defer to RowId
order as a tie-breaker when
looking at several rows worth of data that rest at the exact same timestamp.
In pseudo-code:
rr.set_time_sequence("frame", 10)
rr.log("my_entity", point1, row_id=#1)
rr.log("my_entity", point2, row_id=#0)
rr.query("my_entity", at=("frame", 10)) # returns `point1`
Think carefully about your RowId
s when logging a lot of data at the same timestamp.
§Garbage collection
Garbage collection is handled at the chunk level by first ordering the chunks based on the minimum
RowId
present in each of them.
Garbage collection therefore happens (roughly) in the logger’s wall-clock order.
This has very important implications when inserting data far into the past or into the future:
think carefully about your RowId
s in these cases.
Tuple Fields§
§0: Tuid
Implementations§
source§impl RowId
impl RowId
pub const ZERO: RowId = _
pub const MAX: RowId = _
pub fn from_tuid(tuid: Tuid) -> RowId
sourcepub fn next(&self) -> RowId
pub fn next(&self) -> RowId
Returns the next logical RowId
.
Beware: wrong usage can easily lead to conflicts.
Prefer RowId::new
when unsure.
sourcepub fn incremented_by(&self, n: u64) -> RowId
pub fn incremented_by(&self, n: u64) -> RowId
Returns the n
-next logical RowId
.
This is equivalent to calling RowId::next
n
times.
Wraps the monotonically increasing back to zero on overflow.
Beware: wrong usage can easily lead to conflicts.
Prefer RowId::new
when unsure.
sourcepub fn nanoseconds_since_epoch(&self) -> u64
pub fn nanoseconds_since_epoch(&self) -> u64
When the RowId
was created, in nanoseconds since unix epoch.
pub fn from_u128(id: u128) -> RowId
pub fn as_u128(&self) -> u128
Methods from Deref<Target = Tuid>§
sourcepub fn heap_size_bytes(&self) -> u64
pub fn heap_size_bytes(&self) -> u64
Returns the total size of self
on the heap, in bytes.
NOTE: This crate cannot depend on re_types_core
, therefore the actual implementation of
SizeBytes for Tuid
lives in re_types_core
and calls this method.
pub const ZERO: Tuid = _
pub const MAX: Tuid = _
pub fn as_u128(&self) -> u128
sourcepub fn nanoseconds_since_epoch(&self) -> u64
pub fn nanoseconds_since_epoch(&self) -> u64
Approximate nanoseconds since unix epoch.
The upper 64 bits of the Tuid
.
sourcepub fn incremented_by(&self, n: u64) -> Tuid
pub fn incremented_by(&self, n: u64) -> Tuid
Returns the n
-next logical Tuid
.
This is equivalent to calling Tuid::next
n
times.
Wraps the monotonically increasing back to zero on overflow.
Beware: wrong usage can easily lead to conflicts.
Prefer Tuid::new
when unsure.
sourcepub fn short_string(&self) -> String
pub fn short_string(&self) -> String
A shortened string representation of the Tuid
.
Trait Implementations§
source§impl<'de> Deserialize<'de> for RowId
impl<'de> Deserialize<'de> for RowId
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<RowId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<RowId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl Loggable for RowId
impl Loggable for RowId
type Name = ComponentName
source§fn name() -> <RowId as Loggable>::Name
fn name() -> <RowId as Loggable>::Name
rerun.datatypes.Vec2D
.source§fn arrow_datatype() -> DataType
fn arrow_datatype() -> DataType
arrow2::datatypes::DataType
, excluding datatype extensions.source§fn to_arrow_opt<'a>(
values: impl IntoIterator<Item = Option<impl Into<Cow<'a, RowId>>>>
) -> Result<Box<dyn Array>, SerializationError>where
RowId: 'a,
fn to_arrow_opt<'a>(
values: impl IntoIterator<Item = Option<impl Into<Cow<'a, RowId>>>>
) -> Result<Box<dyn Array>, SerializationError>where
RowId: 'a,
source§fn to_arrow<'a>(
values: impl IntoIterator<Item = impl Into<Cow<'a, RowId>>>
) -> Result<Box<dyn Array>, SerializationError>
fn to_arrow<'a>( values: impl IntoIterator<Item = impl Into<Cow<'a, RowId>>> ) -> Result<Box<dyn Array>, SerializationError>
source§fn from_arrow(
array: &(dyn Array + 'static)
) -> Result<Vec<RowId>, DeserializationError>
fn from_arrow( array: &(dyn Array + 'static) ) -> Result<Vec<RowId>, DeserializationError>
Loggable
s.source§fn from_arrow_opt(
data: &(dyn Array + 'static)
) -> Result<Vec<Option<Self>>, DeserializationError>
fn from_arrow_opt( data: &(dyn Array + 'static) ) -> Result<Vec<Option<Self>>, DeserializationError>
Loggable
s.source§impl Ord for RowId
impl Ord for RowId
source§impl PartialEq for RowId
impl PartialEq for RowId
source§impl PartialOrd for RowId
impl PartialOrd for RowId
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for RowId
impl Serialize for RowId
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
source§impl SizeBytes for RowId
impl SizeBytes for RowId
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 Copy for RowId
impl Eq for RowId
impl StructuralPartialEq for RowId
Auto Trait Implementations§
impl Freeze for RowId
impl RefUnwindSafe for RowId
impl Send for RowId
impl Sync for RowId
impl Unpin for RowId
impl UnwindSafe for RowId
Blanket Implementations§
source§impl<C> AsComponents for Cwhere
C: Component,
impl<C> AsComponents for Cwhere
C: Component,
source§fn as_component_batches(&self) -> Vec<MaybeOwnedComponentBatch<'_>>
fn as_component_batches(&self) -> Vec<MaybeOwnedComponentBatch<'_>>
ComponentBatch
s. Read moresource§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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<C> ComponentBatch for Cwhere
C: Component,
impl<C> ComponentBatch for Cwhere
C: Component,
source§fn to_arrow_list_array(&self) -> Result<ListArray<i32>, SerializationError>
fn to_arrow_list_array(&self) -> Result<ListArray<i32>, SerializationError>
§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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§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