pub enum ExpressionKind {
LoadConstant(Constant),
ArithLog(ArithLogOp, Vec<Expression>),
StreamAccess {
target: StreamReference,
parameters: Vec<Expression>,
access_kind: StreamAccessKind,
},
ParameterAccess(StreamReference, usize),
LambdaParameterAccess {
wref: WindowReference,
pref: usize,
},
Ite {
condition: Box<Expression>,
consequence: Box<Expression>,
alternative: Box<Expression>,
},
Tuple(Vec<Expression>),
TupleAccess(Box<Expression>, usize),
Function(String, Vec<Expression>),
Convert {
expr: Box<Expression>,
},
Default {
expr: Box<Expression>,
default: Box<Expression>,
},
}
Expand description
This enum contains all possible kinds of expressions and their relevant information.
Variants§
LoadConstant(Constant)
Load a constant value
ArithLog(ArithLogOp, Vec<Expression>)
Apply an arithmetic or logic operation. The function is monomorphized.
Note: Arguments never need to be coerced. Unary: 1st argument -> operand Binary: 1st argument -> lhs, 2nd argument -> rhs n-ary: kth argument -> kth operand
StreamAccess
Access another stream
Fields
target: StreamReference
The target stream to be accessed
parameters: Vec<Expression>
The parameters of the specific stream instance that is accessed.
If the stream behind target
is not parametrized, this collection is empty.
access_kind: StreamAccessKind
The kind of access
ParameterAccess(StreamReference, usize)
Access to the parameter of a stream represented by a stream reference, referencing the target stream and the index of the parameter that should be accessed.
LambdaParameterAccess
Access to the lambda parameter in the filtered instance aggregation
Fields
wref: WindowReference
Reference to the instance aggregation using the lambda function
Ite
A conditional (if-then-else) expression
Fields
condition: Box<Expression>
The condition under which either consequence
or alternative
is selected.
consequence: Box<Expression>
The consequence should be evaluated and returned if the condition evaluates to true.
alternative: Box<Expression>
The alternative should be evaluated and returned if the condition evaluates to false.
Tuple(Vec<Expression>)
A tuple expression
TupleAccess(Box<Expression>, usize)
Represents a tuple projections, i.e., it accesses a specific tuple element.
Function(String, Vec<Expression>)
Represents a function call. The function is monomorphized.
Note: Arguments never need to be coerced. Unary: 1st argument -> operand Binary: 1st argument -> lhs, 2nd argument -> rhs n-ary: kth argument -> kth operand
Convert
Converting a value to a different type
The result type is indicated in the expression with the Convert
kind.
Fields
expr: Box<Expression>
The expression that produces a value. The type of the expression indicates the source of the conversion.
Default
Transforms an optional value into a definitive one
Fields
expr: Box<Expression>
The expression that results in an optional value.
default: Box<Expression>
An infallible expression providing the default value if expr
fails to produce a value.
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<'de> Deserialize<'de> for ExpressionKind
impl<'de> Deserialize<'de> for ExpressionKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ExpressionKind
impl PartialEq for ExpressionKind
Source§impl Serialize for ExpressionKind
impl Serialize 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