Struct re_data_store::StoreDiff
source · pub struct StoreDiff {
pub kind: StoreDiffKind,
pub row_id: RowId,
pub times: Vec<(Timeline, TimeInt)>,
pub entity_path: EntityPath,
pub cells: IntMap<ComponentName, DataCell>,
}
Expand description
Describes an atomic change in the Rerun DataStore
: a row has been added or deleted.
From a query model standpoint, the DataStore
always operates one row at a time:
- The contents of a row (i.e. its columns) are immutable past insertion, by virtue of
RowId
s being unique and non-reusable. - Similarly, garbage collection always removes all the data associated with a row in one go: there cannot be orphaned columns. When a row is gone, all data associated with it is gone too.
Refer to field-level documentation for more information.
Fields§
§kind: StoreDiffKind
Addition or deletion?
The store’s internals are opaque and don’t necessarily reflect the query model (e.g. there might be data in the store that cannot by reached by any query).
A StoreDiff
answers a logical question: “does there exist a query path which can return
data from that row?”.
An event of kind deletion only tells you that, from this point on, no query can return data from that row. That doesn’t necessarily mean that the data is actually gone, i.e. don’t make assumptions of e.g. the size in bytes of the store based on these events. They are in “query-model space” and are not an accurate representation of what happens in storage space.
row_id: RowId
What’s the row’s RowId
?
RowId
s are guaranteed to be unique within a single DataStore
.
Put another way, the same RowId
can only appear twice in a StoreDiff
event:
one addition and (optionally) one deletion (in that order!).
times: Vec<(Timeline, TimeInt)>
The time data associated with that row.
Since insertions and deletions both work on a row-level basis, this is guaranteed to be the same value for both the insertion and deletion events (if any).
This is not a TimePoint
for performance reasons.
entity_path: EntityPath
The EntityPath
associated with that row.
Since insertions and deletions both work on a row-level basis, this is guaranteed to be the same value for both the insertion and deletion events (if any).
cells: IntMap<ComponentName, DataCell>
All the DataCell
s associated with that row.
Since insertions and deletions both work on a row-level basis, this is guaranteed to be the same set of values for both the insertion and deletion events (if any).
Implementations§
source§impl StoreDiff
impl StoreDiff
pub fn addition( row_id: impl Into<RowId>, entity_path: impl Into<EntityPath> ) -> Self
pub fn deletion( row_id: impl Into<RowId>, entity_path: impl Into<EntityPath> ) -> Self
pub fn at_timepoint(&mut self, timepoint: impl Into<TimePoint>) -> &mut Self
pub fn at_timestamp( &mut self, timeline: impl Into<Timeline>, time: impl Into<TimeInt> ) -> &mut Self
pub fn with_cells( &mut self, cells: impl IntoIterator<Item = DataCell> ) -> &mut Self
pub fn timepoint(&self) -> TimePoint
pub fn is_static(&self) -> bool
pub fn num_components(&self) -> usize
Trait Implementations§
source§impl PartialEq for StoreDiff
impl PartialEq for StoreDiff
impl StructuralPartialEq for StoreDiff
Auto Trait Implementations§
impl Freeze for StoreDiff
impl !RefUnwindSafe for StoreDiff
impl Send for StoreDiff
impl Sync for StoreDiff
impl Unpin for StoreDiff
impl !UnwindSafe for StoreDiff
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> 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 more