pub fn literal_constraint(&self, expr: &MirScalarExpr) -> Option<Datum> {
        for (_pos, predicate) in self.predicates.iter() {
            if let MirScalarExpr::CallBinary {
                func: crate::BinaryFunc::Eq,
                expr1,
                expr2,
            } = predicate
            {
                if let Some(Ok(datum1)) = expr1.as_literal() {
                    if &**expr2 == expr {
                        return Some(datum1);
                    }
                }
                if let Some(Ok(datum2)) = expr2.as_literal() {
                    if &**expr1 == expr {
                        return Some(datum2);
                    }
                }
            }
        }
        None
    }
/// Determines if a scalar expression must be equal to a literal datum.
Determines if a scalar expression must be equal to a literal datum.
Determines if a scalar expression must be equal to a literal datum .
pub fn literal_constraint(&self, expr: &MirScalarExpr) -> Option<Datum> {
        for (_pos, predicate) in self.predicates.iter() {
            if let MirScalarExpr::CallBinary {
                func: crate::BinaryFunc::Eq,
                expr1,
                expr2,
            } = predicate
            {
                if let Some(Ok(datum1)) = expr1.as_literal() {
                    if &**expr2 == expr {
                        return Some(datum1);
                    }
                }
                if let Some(Ok(datum2)) = expr2.as_literal() {
                    if &**expr1 == expr {
                        return Some(datum2);
                    }
                }
            }
        }
        None
    }
pub fn literal_constraint ( & self , expr : & MirScalarExpr ) -> Option < Datum > { for ( _pos , predicate ) in self . predicates . iter ( ) { if let MirScalarExpr :: CallBinary { func : crate :: BinaryFunc :: Eq , expr1 , expr2 , } = predicate { if let Some ( Ok ( datum1 ) ) = expr1 . as_literal ( ) { if & * * expr2 == expr { return Some ( datum1 ) ; } } if let Some ( Ok ( datum2 ) ) = expr2 . as_literal ( ) { if & * * expr1 == expr { return Some ( datum2 ) ; } } } } None }
Determines if a scalar expression must be equal to a literal datum.
Determines if a scalar expression must be equal to a literal datum .
&self
expr
&MirScalarExpr
&self
expr
&MirScalarExpr