ksql 2.0.0

A JSON data expression lexer, parser, cli and library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::parser::parse::BoxedExpression;
use crate::parser::{Expression, Result, Value};

#[derive(Debug)]
pub(in crate::parser) struct Eq {
    pub left: BoxedExpression,
    pub right: BoxedExpression,
}

impl Expression for Eq {
    fn calculate(&self, json: &[u8]) -> Result<Value> {
        let left = self.left.calculate(json)?;
        let right = self.right.calculate(json)?;
        Ok(Value::Bool(left == right))
    }
}