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§
Sourcetype Error: From<MergeError>
type Error: From<MergeError>
Query failure, including the merge invariant errors checked here.
Required Methods§
Sourcefn row(&self, row: &RowId) -> Result<RemovalRow, Self::Error>
fn row(&self, row: &RowId) -> Result<RemovalRow, Self::Error>
Facts for a row. Unknown keys are Absent { generation: 0 }.
Sourcefn constraints(
&self,
row: &RowId,
references: &BTreeMap<ForeignKey, ReferenceValue>,
) -> Result<Constraints, Self::Error>
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.
Sourcefn children(&self, row: &RowId) -> Result<BTreeSet<RowId>, Self::Error>
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.