caffeine_query_language/parser
Types
Comparators for time slice expressions.
pub type Comparator {
LessThan
LessThanOrEqualTo
GreaterThan
GreaterThanOrEqualTo
}
Constructors
-
LessThan -
LessThanOrEqualTo -
GreaterThan -
GreaterThanOrEqualTo
An expression in the CQL AST, either an operator expression or a primary.
pub type Exp {
TimeSliceExpr(spec: TimeSliceExp)
OperatorExpr(
numerator: Exp,
denominator: Exp,
operator: Operator,
)
Primary(primary: Primary)
}
Constructors
-
TimeSliceExpr(spec: TimeSliceExp) -
-
Primary(primary: Primary)
Arithmetic operators supported in CQL expressions.
pub type Operator {
Add
Sub
Mul
Div
}
Constructors
-
Add -
Sub -
Mul -
Div
Time slice specification containing query, comparator, threshold, and interval.
pub type TimeSliceExp {
TimeSliceExp(
query: String,
comparator: Comparator,
threshold: Float,
interval_seconds: Float,
)
}
Constructors
-
TimeSliceExp( query: String, comparator: Comparator, threshold: Float, interval_seconds: Float, )
Values
pub fn parse_expr(input: String) -> Result(ExpContainer, String)
Parses a CQL expression string into an ExpContainer. Returns an error if the input cannot be parsed.