pub struct RowState<V> { /* private fields */ }Expand description
One table, key and audience’s merged state. Removed rows retain this state; a removal never advances their generation (§8.4).
Implementations§
Source§impl<V> RowState<V>
impl<V> RowState<V>
Sourcepub fn from_parts<O: WriteOracle>(
row: RowId,
generations: BTreeMap<u64, WriteId>,
cells: BTreeMap<String, Cell<V>>,
lost: BTreeMap<LostKey, LostValue<V>>,
oracle: &O,
) -> Result<Self, O::Error>
pub fn from_parts<O: WriteOracle>( row: RowId, generations: BTreeMap<u64, WriteId>, cells: BTreeMap<String, Cell<V>>, lost: BTreeMap<LostKey, LostValue<V>>, oracle: &O, ) -> Result<Self, O::Error>
Load the compact records kept by the database or a snapshot. Validate
their generation sequence, cell presence, reference metadata and lost
replacers without replaying write bodies. As with apply, the oracle
is the causally closed applied set; it supplies timestamps and past.
Sourcepub fn validate_loss<O: WriteOracle>(
&self,
key: &LostKey,
value: &LostValue<V>,
oracle: &O,
) -> Result<(), O::Error>
pub fn validate_loss<O: WriteOracle>( &self, key: &LostKey, value: &LostValue<V>, oracle: &O, ) -> Result<(), O::Error>
Validate an independently decoded cell loss against this row’s validated
generations and winning cells. The oracle is the causally closed applied
set, as for from_parts; existing losses do not affect this check.
Sourcepub fn generation(&self) -> u64
pub fn generation(&self) -> u64
How many times the row has been created, deleted or re-added.
Sourcepub fn present(&self) -> bool
pub fn present(&self) -> bool
Whether the row is present in merged state, before removal rules.
Sourcepub fn generations(&self) -> &BTreeMap<u64, WriteId>
pub fn generations(&self) -> &BTreeMap<u64, WriteId>
The smallest-stamped write that moved the row to each generation.
Sourcepub fn cells(&self) -> &BTreeMap<String, Cell<V>>
pub fn cells(&self) -> &BTreeMap<String, Cell<V>>
The winning write and value of every set column.
Sourcepub fn lost(&self) -> &BTreeMap<LostKey, LostValue<V>>
pub fn lost(&self) -> &BTreeMap<LostKey, LostValue<V>>
Every lost value, its incarnation and what replaced it.
Sourcepub fn map_schema(
self,
row: RowId,
column: impl FnMut(String, ColumnValue<V>) -> Option<(String, ColumnValue<V>)>,
) -> Self
pub fn map_schema( self, row: RowId, column: impl FnMut(String, ColumnValue<V>) -> Option<(String, ColumnValue<V>)>, ) -> Self
Carry a row through a schema change. The caller supplies the surviving identity and maps each column value, including its reference identities. Dropped columns disappear; generations, setters and replacers stay fixed.