Enum ExpressionKind

Source
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

§wait: bool

Flag to mark that the window returns only a value if the complete duration has passed

§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

§wait: bool

Flag to mark that the window returns only a value if the complete duration has passed

§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

Source§

fn clone(&self) -> ExpressionKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExpressionKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for ExpressionKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for ExpressionKind

Source§

fn cmp(&self, other: &ExpressionKind) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for ExpressionKind

Source§

fn eq(&self, other: &ExpressionKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for ExpressionKind

Source§

fn partial_cmp(&self, other: &ExpressionKind) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Eq for ExpressionKind

Source§

impl StructuralPartialEq for ExpressionKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.