pub trait FallibleRule<C: ConventionMarker>:
Send
+ Sync
+ Description {
// Required method
fn apply(&self, plan: PlanRef<C>) -> ApplyResult<PlanRef<C>>;
}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<C>) -> ApplyResult<PlanRef<C>>
fn apply(&self, plan: PlanRef<C>) -> ApplyResult<PlanRef<C>>
Apply the rule to the plan node, which may return an unrecoverable error.
- Returns
ApplyResult::Okif the apply is successful. - Returns
ApplyResult::NotApplicableif it’s not applicable. The optimizer may try other rules. - Returns
ApplyResult::Errif an unrecoverable error occurred. The optimizer should stop applying other rules and report the error to the user.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".