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: Self = _
pub const MAX: Self = _
pub fn from_tuid(tuid: Tuid) -> Self
sourcepub fn next(&self) -> Self
pub fn next(&self) -> Self
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) -> Self
pub fn incremented_by(&self, n: u64) -> Self
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) -> Self
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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Loggable for RowId
impl Loggable for RowId
type Name = ComponentName
source§fn name() -> Self::Name
fn name() -> Self::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, Self>>>>
) -> SerializationResult<Box<dyn Array>>where
Self: 'a,
fn to_arrow_opt<'a>(
values: impl IntoIterator<Item = Option<impl Into<Cow<'a, Self>>>>
) -> SerializationResult<Box<dyn Array>>where
Self: 'a,
Loggable
], serializes them into an Arrow array. Read moresource§fn to_arrow<'a>(
values: impl IntoIterator<Item = impl Into<Cow<'a, Self>>>
) -> SerializationResult<Box<dyn Array>>
fn to_arrow<'a>( values: impl IntoIterator<Item = impl Into<Cow<'a, Self>>> ) -> SerializationResult<Box<dyn Array>>
Loggable
], serializes
them into an Arrow array. Read moresource§fn from_arrow(array: &dyn Array) -> DeserializationResult<Vec<Self>>
fn from_arrow(array: &dyn Array) -> DeserializationResult<Vec<Self>>
Loggable
]s.§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 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.§fn total_size_bytes(&self) -> u64
fn total_size_bytes(&self) -> u64
self
in bytes, accounting for both stack and heap space.§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§
§impl<C> AsComponents for Cwhere
C: Component,
impl<C> AsComponents for Cwhere
C: Component,
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<C> ComponentBatch for Cwhere
C: Component,
impl<C> ComponentBatch for Cwhere
C: Component,
§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.§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 more