pub trait Rebuilder: Send + Sync {
// Required methods
fn hint_col(&self) -> Option<ColumnId>;
fn rebuild_val(&self, val: Value) -> Value;
fn rebuild_buf(
&self,
buf: &RowBuffer,
start: RowId,
end: RowId,
out: &mut TaggedRowBuffer,
exec_state: &mut ExecutionState<'_>,
);
fn rebuild_subset(
&self,
other: WrappedTableRef<'_>,
subset: SubsetRef<'_>,
out: &mut TaggedRowBuffer,
exec_state: &mut ExecutionState<'_>,
);
fn rebuild_slice(&self, vals: &mut [Value]) -> bool;
}Expand description
Custom functions used for tables that encode a bulk value-level rebuild of other tables.
The initial use-case for this trait is to support optimized implementations of rebuilding,
where Rebuilder is implemented as a Union-find.
Value-level rebuilds are difficult to implement efficiently using rules as they require searching for changes to any column for a table: while it is possible to do, implementing this custom is more efficient in the case of rebuilding.
Required Methods§
Sourcefn hint_col(&self) -> Option<ColumnId>
fn hint_col(&self) -> Option<ColumnId>
The column that contains values that should be rebuilt. If this is set, callers can use this functionality to perform rebuilds incrementally.
fn rebuild_val(&self, val: Value) -> Value
Sourcefn rebuild_buf(
&self,
buf: &RowBuffer,
start: RowId,
end: RowId,
out: &mut TaggedRowBuffer,
exec_state: &mut ExecutionState<'_>,
)
fn rebuild_buf( &self, buf: &RowBuffer, start: RowId, end: RowId, out: &mut TaggedRowBuffer, exec_state: &mut ExecutionState<'_>, )
Rebuild a contiguous slice of rows in the table.
Sourcefn rebuild_subset(
&self,
other: WrappedTableRef<'_>,
subset: SubsetRef<'_>,
out: &mut TaggedRowBuffer,
exec_state: &mut ExecutionState<'_>,
)
fn rebuild_subset( &self, other: WrappedTableRef<'_>, subset: SubsetRef<'_>, out: &mut TaggedRowBuffer, exec_state: &mut ExecutionState<'_>, )
Rebuild an arbitrary subset of the table.
Sourcefn rebuild_slice(&self, vals: &mut [Value]) -> bool
fn rebuild_slice(&self, vals: &mut [Value]) -> bool
Rebuild a slice of values in place, returning true if any values were changed.