Trait sql::query_model::rewrite::ApplyRule [−][src]
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
fn strategy(&self) -> ApplyStrategy
fn strategy(&self) -> ApplyStrategy
The ApplyStrategy
for the rule.
fn required_attributes(&self) -> HashSet<Box<dyn Attribute>>
fn required_attributes(&self) -> HashSet<Box<dyn Attribute>>
Derived attributes required by this ApplyRule
.