use crate::graph::GraphStorage;
use crate::traversal::optimizer::plan::Plan;
use crate::traversal::step::GraphStep;
#[allow(dead_code)]
pub(crate) trait OptimizationRule<'g, S: GraphStorage + 'g>: Send + Sync {
fn name(&self) -> &'static str;
fn apply(&self, plan: &mut Plan<'g, S>) -> bool;
fn apply_to_steps(&self, steps: &mut Vec<GraphStep<'g, S>>) -> bool {
let mut plan = Plan::from_steps(std::mem::take(steps), true);
let modified = self.apply(&mut plan);
*steps = plan.into_steps();
modified
}
}