pub trait FallibleRule:
Send
+ Sync
+ Description {
// Required method
fn apply(&self, plan: PlanRef) -> ApplyResult;
}
Expand description
An one-to-one transform for the PlanNode
that may return an
unrecoverable error that stops further optimization.
An InfallibleRule
is always a FallibleRule
.
Required Methods§
sourcefn apply(&self, plan: PlanRef) -> ApplyResult
fn apply(&self, plan: PlanRef) -> ApplyResult
Apply the rule to the plan node, which may return an unrecoverable error.
- Returns
ApplyResult::Ok
if the apply is successful. - Returns
ApplyResult::NotApplicable
if it’s not applicable. The optimizer may try other rules. - Returns
ApplyResult::Err
if an unrecoverable error occurred. The optimizer should stop applying other rules and report the error to the user.