Struct re_log_types::RowId
source · pub struct RowId(/* private fields */);
Expand description
A unique ID for a DataRow
.
§Semantics
RowId
s play an important role in how we store, query and garbage collect data.
§Storage
RowId
s must be unique within a DataStore
. This is enforced by the store’s APIs.
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 happens in RowId
-order, which roughly means that it happens in the
logger’s wall-clock order.
This has very important implications where inserting data far into the past or into the future:
think carefully about your RowId
s in these cases.
Implementations§
source§impl RowId
impl RowId
pub const ZERO: Self = _
pub const MAX: 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.
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.
The Arrow array’s datatype will match Loggable::arrow_field
. 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.
The Arrow array’s datatype will match Loggable::arrow_field
. Read moresource§fn from_arrow(array: &dyn Array) -> DeserializationResult<Vec<Self>>
fn from_arrow(array: &dyn Array) -> DeserializationResult<Vec<Self>>
source§fn extended_arrow_datatype() -> DataType
fn extended_arrow_datatype() -> DataType
arrow2::datatypes::DataType
, including datatype extensions. Read moresource§fn arrow_field() -> Field
fn arrow_field() -> Field
arrow2::datatypes::Field
, including datatype extensions. Read moresource§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>
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.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<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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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<L> LoggableBatch for L
impl<L> LoggableBatch for L
type Name = <L as Loggable>::Name
source§fn name(&self) -> <L as LoggableBatch>::Name
fn name(&self) -> <L as LoggableBatch>::Name
rerun.datatypes.Vec2D
.source§fn num_instances(&self) -> usize
fn num_instances(&self) -> usize
source§fn arrow_field(&self) -> Field
fn arrow_field(&self) -> Field
arrow2::datatypes::Field
, including datatype extensions.