pub struct StoreDiff {
pub kind: StoreDiffKind,
pub row_id: RowId,
pub times: Vec<(Timeline, TimeInt)>,
pub entity_path: EntityPath,
pub cells: HashMap<ComponentName, DataCell, BuildHasherDefault<NoHashHasher<ComponentName>>>,
}
Expand description
Everything needed to build custom StoreSubscriber
s.
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: HashMap<ComponentName, DataCell, BuildHasherDefault<NoHashHasher<ComponentName>>>
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).