Skip to main content

RuleCatalog

Trait RuleCatalog 

Source
pub trait RuleCatalog {
    // Required methods
    fn relation_has_rules(&self, table: &str) -> Result<bool, SQLError>;
    fn resolve_rule_relation(
        &self,
        table: &str,
    ) -> Result<RelationIdentity, SQLError>;
    fn rules_for(
        &self,
        table: &str,
        event: RuleEvent,
    ) -> Result<Vec<StoredRule>, SQLError>;
    fn resolve_mutation_target(
        &self,
        name: &str,
        bound: bool,
    ) -> Result<String, SQLError>;

    // Provided methods
    fn capture_rules(
        &self,
        table: &str,
        event: RuleEvent,
    ) -> Result<CapturedRules, SQLError> { ... }
    fn capture_rules_with_control(
        &self,
        table: &str,
        event: RuleEvent,
        control: &ProductionControl<'_>,
    ) -> Result<CapturedRules, SQLError> { ... }
    fn visit_rules_with_control(
        &self,
        table: &str,
        event: RuleEvent,
        reverse: bool,
        control: &ProductionControl<'_>,
        visit: &mut dyn FnMut(&StoredRule) -> Result<(), SQLError>,
    ) -> Result<(), SQLError> { ... }
    fn resolve_rule_relation_with_control(
        &self,
        table: &str,
        control: &ProductionControl<'_>,
    ) -> Result<Produced<RelationIdentity>, SQLError> { ... }
    fn resolve_mutation_target_with_control(
        &self,
        name: &str,
        bound: bool,
        control: &ProductionControl<'_>,
    ) -> Result<Produced<String>, SQLError> { ... }
}
Expand description

Resolve stored rule definitions and a mutation’s canonical target.

Required Methods§

Provided Methods§

Source

fn capture_rules( &self, table: &str, event: RuleEvent, ) -> Result<CapturedRules, SQLError>

Source

fn capture_rules_with_control( &self, table: &str, event: RuleEvent, control: &ProductionControl<'_>, ) -> Result<CapturedRules, SQLError>

Capture active execution rules at the ordinary lookup boundary. Native catalogs retain the live immutable registry generation without copying its declarations.

Source

fn visit_rules_with_control( &self, table: &str, event: RuleEvent, reverse: bool, control: &ProductionControl<'_>, visit: &mut dyn FnMut(&StoredRule) -> Result<(), SQLError>, ) -> Result<(), SQLError>

External catalogs may supply owned metadata. Native catalogs override this observation to lend the selected immutable rule declarations directly.

Source

fn resolve_rule_relation_with_control( &self, table: &str, control: &ProductionControl<'_>, ) -> Result<Produced<RelationIdentity>, SQLError>

Source

fn resolve_mutation_target_with_control( &self, name: &str, bound: bool, control: &ProductionControl<'_>, ) -> Result<Produced<String>, SQLError>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§