Trait mz_transform::analysis::equivalences::ExpressionReducer
source · pub trait ExpressionReducer {
// Required method
fn replace(&self, expr: &mut MirScalarExpr) -> bool;
// Provided methods
fn reduce_expr(&self, expr: &mut MirScalarExpr) -> bool { ... }
fn reduce_child(&self, expr: &mut MirScalarExpr) -> bool { ... }
}
Expand description
A type capable of simplifying MirScalarExpr
s.
Required Methods§
sourcefn replace(&self, expr: &mut MirScalarExpr) -> bool
fn replace(&self, expr: &mut MirScalarExpr) -> bool
Attempt to replace expr
itself with another expression.
Returns true if it does so.
Provided Methods§
sourcefn reduce_expr(&self, expr: &mut MirScalarExpr) -> bool
fn reduce_expr(&self, expr: &mut MirScalarExpr) -> bool
Attempt to replace any subexpressions of expr
with other expressions.
Returns true if it does so.
sourcefn reduce_child(&self, expr: &mut MirScalarExpr) -> bool
fn reduce_child(&self, expr: &mut MirScalarExpr) -> bool
Attempt to replace any subexpressions of expr
’s children with other expressions.
Returns true if it does so.
Implementations on Foreign Types§
source§impl ExpressionReducer for BTreeMap<&MirScalarExpr, &MirScalarExpr>
impl ExpressionReducer for BTreeMap<&MirScalarExpr, &MirScalarExpr>
source§fn replace(&self, expr: &mut MirScalarExpr) -> bool
fn replace(&self, expr: &mut MirScalarExpr) -> bool
Perform any exact replacement for expr
, report if it had an effect.
source§impl ExpressionReducer for BTreeMap<MirScalarExpr, MirScalarExpr>
impl ExpressionReducer for BTreeMap<MirScalarExpr, MirScalarExpr>
source§fn replace(&self, expr: &mut MirScalarExpr) -> bool
fn replace(&self, expr: &mut MirScalarExpr) -> bool
Perform any exact replacement for expr
, report if it had an effect.