Struct rerun::StoreDiff

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 StoreSubscribers. 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 RowIds 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?

RowIds 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 DataCells 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§

§

impl StoreDiff

pub fn addition( row_id: impl Into<RowId>, entity_path: impl Into<EntityPath> ) -> StoreDiff

pub fn deletion( row_id: impl Into<RowId>, entity_path: impl Into<EntityPath> ) -> StoreDiff

pub fn at_timepoint( &mut self, timepoint: impl Into<TimePoint> ) -> &mut StoreDiff

pub fn at_timestamp( &mut self, timeline: impl Into<Timeline>, time: impl Into<TimeInt> ) -> &mut StoreDiff

pub fn with_cells( &mut self, cells: impl IntoIterator<Item = DataCell> ) -> &mut StoreDiff

pub fn timepoint(&self) -> TimePoint

pub fn is_timeless(&self) -> bool

pub fn delta(&self) -> i64

-1 for deletions, +1 for additions.

pub fn num_components(&self) -> usize

Trait Implementations§

§

impl Clone for StoreDiff

§

fn clone(&self) -> StoreDiff

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for StoreDiff

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl PartialEq for StoreDiff

§

fn eq(&self, other: &StoreDiff) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl StructuralPartialEq for StoreDiff

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

source§

fn lossy_into(self) -> Dst

Performs the conversion.
source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.
§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSync for T
where T: Sync,