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§

source

fn replace(&self, expr: &mut MirScalarExpr) -> bool

Attempt to replace expr itself with another expression. Returns true if it does so.

Provided Methods§

source

fn reduce_expr(&self, expr: &mut MirScalarExpr) -> bool

Attempt to replace any subexpressions of expr with other expressions. Returns true if it does so.

source

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>

source§

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>

source§

fn replace(&self, expr: &mut MirScalarExpr) -> bool

Perform any exact replacement for expr, report if it had an effect.

Implementors§