Module ast

Module ast 

Source
Expand description

Abstract Syntax Tree (AST) types for PromQL expressions.

This module defines all the types that make up the parsed representation of a PromQL query. The main type is Expr, which represents any valid PromQL expression.

§Overview

PromQL expressions can be:

§Display

All AST types implement std::fmt::Display to convert back to PromQL syntax:

use rusty_promql_parser::expr;

let (_, ast) = expr("sum(rate(http_requests[5m]))").unwrap();
println!("{}", ast); // Prints: sum(rate(http_requests[5m]))

Structs§

Aggregation
Aggregation expression
BinaryExpr
Binary expression
BinaryModifier
Modifier for binary operations
Call
Function call expression
GroupModifier
Group modifier for many-to-one/one-to-many matching
SubqueryExpr
Subquery expression
UnaryExpr
Unary expression
VectorMatching
Vector matching specification for binary operations

Enums§

BinaryOp
Binary operators
Expr
Root expression type for PromQL AST
GroupSide
Group modifier side
UnaryOp
Unary operators
VectorMatchingOp
Vector matching for binary operations