Skip to main content

binary

Function binary 

Source
pub fn binary(
    operator: impl Into<BinaryOperator>,
    lhs: Expression,
    rhs: Expression,
) -> Expression
Expand description

Creates the expression lhs <operator> rhs with the function that owns the operator.

let sum = binary(NumericOperator::Add, col("x"), lit(1_i32));
let expr = binary(CompareOperator::Gt, sum, lit(10_i32));
assert_eq!(expr.to_string(), "(($.x + 1i32) > 10i32)");