pub enum ExpressionKind {
Show 18 variants
Lit(Literal),
Ident(Ident),
StreamAccess(Box<Expression>, StreamAccessKind),
Default(Box<Expression>, Box<Expression>),
Offset(Box<Expression>, Offset),
DiscreteWindowAggregation {
expr: Box<Expression>,
duration: Box<Expression>,
wait: bool,
aggregation: WindowOperation,
},
SlidingWindowAggregation {
expr: Box<Expression>,
duration: Box<Expression>,
wait: bool,
aggregation: WindowOperation,
},
InstanceAggregation {
expr: Box<Expression>,
selection: InstanceSelection,
aggregation: InstanceOperation,
},
Binary(BinOp, Box<Expression>, Box<Expression>),
Unary(UnOp, Box<Expression>),
Ite(Box<Expression>, Box<Expression>, Box<Expression>),
ParenthesizedExpression(Box<Expression>),
MissingExpression,
Tuple(Vec<Expression>),
Field(Box<Expression>, Ident),
Method(Box<Expression>, FunctionName, Vec<Type>, Vec<Expression>),
Function(FunctionName, Vec<Type>, Vec<Expression>),
Lambda(LambdaExpr),
}
Expand description
The Ast representation of a single expression
Variants§
Lit(Literal)
A literal, e.g., 1
, "foo"
Ident(Ident)
An identifier, e.g., foo
StreamAccess(Box<Expression>, StreamAccessKind)
Accessing a stream
Default(Box<Expression>, Box<Expression>)
A default expression, e.g., a.defaults(to: 0)
Offset(Box<Expression>, Offset)
An offset expression, e.g., a.offset(by: -1)
DiscreteWindowAggregation
A discrete window with a duration duration
as an integer constant and aggregation function aggregation
Fields
expr: Box<Expression>
The accesses stream
duration: Box<Expression>
The duration of the window
aggregation: WindowOperation
The aggregation function
SlidingWindowAggregation
A sliding window with duration duration
and aggregation function aggregation
Fields
expr: Box<Expression>
The accesses stream
duration: Box<Expression>
The duration of the window
aggregation: WindowOperation
The aggregation function
InstanceAggregation
A aggregation over stream-instances with instances instances
and aggregation function aggregation
Fields
expr: Box<Expression>
The accesses stream
selection: InstanceSelection
Flag to indicate which instances are part of the aggregation
aggregation: InstanceOperation
The aggregation function
Binary(BinOp, Box<Expression>, Box<Expression>)
A binary operation (For example: a + b
, a * b
)
Unary(UnOp, Box<Expression>)
A unary operation (For example: !x
, *x
)
Ite(Box<Expression>, Box<Expression>, Box<Expression>)
An if-then-else expression
ParenthesizedExpression(Box<Expression>)
An expression enveloped in parentheses
MissingExpression
An expression was expected, e.g., after an operator like *
Tuple(Vec<Expression>)
A tuple expression
Field(Box<Expression>, Ident)
Access of a named (obj.foo
) or unnamed (obj.0
) struct field
Method(Box<Expression>, FunctionName, Vec<Type>, Vec<Expression>)
A method call, e.g., foo.bar(-1)
Function(FunctionName, Vec<Type>, Vec<Expression>)
A function call
Lambda(LambdaExpr)
A lambda expression used in filtered instance aggregations
Trait Implementations§
Source§impl Clone for ExpressionKind
impl Clone for ExpressionKind
Source§fn clone(&self) -> ExpressionKind
fn clone(&self) -> ExpressionKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ExpressionKind
impl Debug for ExpressionKind
Source§impl Hash for ExpressionKind
impl Hash for ExpressionKind
Source§impl Ord for ExpressionKind
impl Ord for ExpressionKind
Source§fn cmp(&self, other: &ExpressionKind) -> Ordering
fn cmp(&self, other: &ExpressionKind) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ExpressionKind
impl PartialEq for ExpressionKind
Source§impl PartialOrd for ExpressionKind
impl PartialOrd for ExpressionKind
impl Eq for ExpressionKind
impl StructuralPartialEq for ExpressionKind
Auto Trait Implementations§
impl Freeze for ExpressionKind
impl RefUnwindSafe for ExpressionKind
impl !Send for ExpressionKind
impl !Sync for ExpressionKind
impl Unpin for ExpressionKind
impl UnwindSafe for ExpressionKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more