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 MirScalarExprs.
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
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.