Skip to main content

FallibleRule

Trait FallibleRule 

Source
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§

Source

fn apply(&self, plan: PlanRef<C>) -> ApplyResult<PlanRef<C>>

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.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§