pub trait GridRow:
Send
+ Sync
+ 'static {
type Key: Clone + Eq + Hash + Debug + Send + Sync + 'static;
type Column: GridColumns;
// Required methods
fn key(&self) -> &Self::Key;
fn value(&self, column: Self::Column) -> CellValue<'_>;
// Provided methods
fn changed_columns(&self, previous: &Self, out: &mut ColumnSet) { ... }
fn parent_key(&self) -> Option<&Self::Key> { ... }
fn change_direction(
&self,
previous: &Self,
column: Self::Column,
) -> Option<ChangeDirection> { ... }
}Expand description
A row of the grid. Rows are immutable snapshots shared through Arc.
Required Associated Types§
Sourcetype Column: GridColumns
type Column: GridColumns
The columns of the row type.
Required Methods§
Provided Methods§
Sourcefn changed_columns(&self, previous: &Self, out: &mut ColumnSet)
fn changed_columns(&self, previous: &Self, out: &mut ColumnSet)
Adds to out the columns whose values differ from previous.
The default compares every column with GridRow::value; override
it when the producer knows cheaper what changed. Called by ingest,
and by a writer whose upsert takes the place of a pending upsert of
the same key (WriteCoalescing::ByKey),
under the store’s write lock: it must not lock.
Sourcefn parent_key(&self) -> Option<&Self::Key>
fn parent_key(&self) -> Option<&Self::Key>
The parent row’s key in a tree view; None for a root. Called in
the background while a tree is built, and by ingest (or a writer
whose upsert merges into a pending one) on every replacement of the
row, to compare it with the previous version
(ChangeSet::has_parent_change):
it must not allocate or lock.
Sourcefn change_direction(
&self,
previous: &Self,
column: Self::Column,
) -> Option<ChangeDirection>
fn change_direction( &self, previous: &Self, column: Self::Column, ) -> Option<ChangeDirection>
The direction of column after a change from previous.
The default is Up or Down when both values are numbers, by
CellValue::cmp_total, and None otherwise or when they are
equal. Override it for a column whose rise is bad news, such as a
spread. Called for changed columns only, by ingest or by a writer
whose upsert merges into a pending one: it must not allocate or lock.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.