Skip to main content

RemovalView

Trait RemovalView 

Source
pub trait RemovalView {
    type Error: From<MergeError>;

    // Required methods
    fn row(&self, row: &RowId) -> Result<RemovalRow, Self::Error>;
    fn constraints(
        &self,
        row: &RowId,
        references: &BTreeMap<ForeignKey, ReferenceValue>,
    ) -> Result<Constraints, Self::Error>;
    fn children(&self, row: &RowId) -> Result<BTreeSet<RowId>, Self::Error>;
    fn groups(&self, row: &RowId) -> Result<BTreeSet<Group>, Self::Error>;
    fn members(&self, group: &Group) -> Result<BTreeSet<RowId>, Self::Error>;
}
Expand description

Abstract database view for the removal rules. All answers are functions of the merged state and applied admin slots, independent of which rows are removed. An adapter can prepare this view in memory; the merge itself performs no I/O.

Required Associated Types§

Source

type Error: From<MergeError>

Query failure, including the merge invariant errors checked here.

Required Methods§

Source

fn row(&self, row: &RowId) -> Result<RemovalRow, Self::Error>

Facts for a row. Unknown keys are Absent { generation: 0 }.

Source

fn constraints( &self, row: &RowId, references: &BTreeMap<ForeignKey, ReferenceValue>, ) -> Result<Constraints, Self::Error>

Evaluate constraints on merged values with these resolved references. Substitution permission is supplied with the reference; CHECK results here describe the merged values that remain after that decision.

Source

fn children(&self, row: &RowId) -> Result<BTreeSet<RowId>, Self::Error>

Rows whose references point at this row: the rows its removal takes out with it. Include removed rows and references before substitution. A row’s parents come from Self::row; competition belongs in Self::groups, not in these edges.

Source

fn groups(&self, row: &RowId) -> Result<BTreeSet<Group>, Self::Error>

The row’s key group and its current unique claim groups, using values after reference substitution. Include removed rows’ claims. The union of the before/after views in recompute covers groups a row left.

Source

fn members(&self, group: &Group) -> Result<BTreeSet<RowId>, Self::Error>

Every row in a competition group, including absent and removed rows, regardless of rank. Region discovery visits each group once per view.

Implementors§