Trait mz_sql::query_model::rewrite::ApplyRule
source · pub(crate) trait ApplyRule {
fn name(&self) -> &'static str;
fn strategy(&self) -> ApplyStrategy;
fn required_attributes(&self) -> HashSet<Box<dyn Attribute>>;
fn apply(&self, model: &mut Model, box_id: BoxId) -> bool;
}Expand description
A trait with a blanket implementation that abstracts over the
associated Rule::Match and its use sites Rule::check and Rule::rewrite
behind ApplyRule::apply method.
Allows for holding a vector of rules in a Vec<dyn ApplyRule> instances.
Required Methods§
sourcefn strategy(&self) -> ApplyStrategy
fn strategy(&self) -> ApplyStrategy
The ApplyStrategy for the rule.