pub struct CostBasedOptimizer<'a> { /* private fields */ }Expand description
Cost-based optimizer that explores rewrite space.
Implementations§
Source§impl<'a> CostBasedOptimizer<'a>
impl<'a> CostBasedOptimizer<'a>
Sourcepub fn new(context: &'a CompilerContext) -> Self
pub fn new(context: &'a CompilerContext) -> Self
Create a new cost-based optimizer.
Sourcepub fn with_cost_weights(self, weights: CostWeights) -> Self
pub fn with_cost_weights(self, weights: CostWeights) -> Self
Set custom cost weights.
Sourcepub fn with_max_alternatives(self, max: usize) -> Self
pub fn with_max_alternatives(self, max: usize) -> Self
Set maximum number of alternatives to explore.
Sourcepub fn optimize(&mut self, expr: &TLExpr) -> (TLExpr, CostBasedStats)
pub fn optimize(&mut self, expr: &TLExpr) -> (TLExpr, CostBasedStats)
Optimize an expression by cost.
Auto Trait Implementations§
impl<'a> Freeze for CostBasedOptimizer<'a>
impl<'a> RefUnwindSafe for CostBasedOptimizer<'a>
impl<'a> Send for CostBasedOptimizer<'a>
impl<'a> Sync for CostBasedOptimizer<'a>
impl<'a> Unpin for CostBasedOptimizer<'a>
impl<'a> UnwindSafe for CostBasedOptimizer<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more