substrait/parse/text/simple_extensions/
boolean_expr.rs1use std::fmt;
6
7use super::types::IntegerParameter;
8
9#[derive(Clone, Debug, PartialEq)]
11pub enum BooleanExpr {
12 Compare {
14 op: ComparisonOp,
16 left: Box<IntegerParameter>,
18 right: Box<IntegerParameter>,
20 },
21}
22
23#[derive(Clone, Copy, Debug, PartialEq, Eq)]
25pub enum ComparisonOp {
26 Greater,
28}
29
30impl fmt::Display for ComparisonOp {
31 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
32 match self {
33 Self::Greater => f.write_str(">"),
34 }
35 }
36}
37
38impl fmt::Display for BooleanExpr {
39 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
40 match self {
41 Self::Compare { op, left, right } => write!(f, "({left}) {op} ({right})"),
42 }
43 }
44}