Skip to main content

ExpressionKind

Enum ExpressionKind 

Source
pub enum ExpressionKind {
Show 22 variants Literal(Value), ImplicitRowValue, Reference(Reference), Now, DateRelative(DateRelativeKind, ExprId), DateCalendar(DateCalendarKind, CalendarPeriodUnit, ExprId), RangeLiteral(ExprId, ExprId), PastFutureRange(DateRelativeKind, ExprId), RangeContainment(ExprId, ExprId), RangeBound(RangeBound, ExprId), Logical { connective: LogicalConnective, first: ExprId, steps: Vec<ChainStep<()>>, }, Arithmetic { first: ExprId, steps: Vec<ChainStep<ArithmeticComputation>>, }, Comparison(ExprId, ComparisonComputation, ExprId), UnitConversion(ExprId, ConversionTarget), LogicalNegation(ExprId, NegationType), MathematicalComputation(MathematicalComputation, ExprId), Veto(VetoExpression), ResultIsVeto(ExprId), ListType { element: ParentType, }, ListCommand { list: ExprId, command: ListCommand, }, StepRounding { operand: ExprId, mode: RoundingMode, step: Option<ExprId>, }, Member { base: ExprId, path: Reference, },
}
Expand description

The kind/type of expression

Variants§

§

Literal(Value)

Parse-time literal value (type will be resolved during planning)

§

ImplicitRowValue

Parser-only current value-list row inside a headless predicate comparison.

§

Reference(Reference)

Unresolved reference (identifier or dot path). Resolved during planning to DataPath or RulePath.

§

Now

The now keyword — resolves to the evaluation datetime (= effective).

§

DateRelative(DateRelativeKind, ExprId)

Date-relative sugar: <date_expr> in past / <date_expr> in future Fields: (kind, date_expression)

§

DateCalendar(DateCalendarKind, CalendarPeriodUnit, ExprId)

Calendar-period sugar: <date_expr> in [past|future] calendar year|month|week Fields: (kind, unit, date_expression)

§

RangeLiteral(ExprId, ExprId)

Range literal: {left_expr}...{right_expr}

§

PastFutureRange(DateRelativeKind, ExprId)

Relative date range: past 7 day / future 30 day

§

RangeContainment(ExprId, ExprId)

Range containment: {value_expr} in {range_expr}

§

RangeBound(RangeBound, ExprId)

Ordered endpoint of a range: lower (included) or upper (excluded).

§

Logical

One left fold of one logical connective, operands in source order.

Fields

§first: ExprId
§steps: Vec<ChainStep<()>>
§

Arithmetic

a + b - c * d: one left fold per precedence level, operands in source order.

Fields

§first: ExprId
§steps: Vec<ChainStep<ArithmeticComputation>>
§

Comparison(ExprId, ComparisonComputation, ExprId)

§

UnitConversion(ExprId, ConversionTarget)

§

LogicalNegation(ExprId, NegationType)

§

MathematicalComputation(MathematicalComputation, ExprId)

§

Veto(VetoExpression)

§

ResultIsVeto(ExprId)

expr is veto / veto is expr — boolean: whether evaluating expr yields OperationResult::Veto.

§

ListType

Type in expression position: text list, money list, money range list.

Fields

§element: ParentType
§

ListCommand

Postfix -> list command: fares -> sum, fares -> where >= 100 eur.

Fields

§list: ExprId
§command: ListCommand
§

StepRounding

Postfix -> rounding: x -> round, or price -> round 0.05 eur with a step.

Fields

§operand: ExprId
§step: Option<ExprId>
§

Member

Postfix member read on a parenthesised expression: (staff -> find "ada").salary.

Fields

§base: ExprId
§path: Reference

Trait Implementations§

Source§

impl Clone for ExpressionKind

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PartialEq for ExpressionKind

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ExpressionKind

Auto Trait Implementations§

§

impl Forget for ExpressionKind

§

impl Freeze for ExpressionKind
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, *const Value is !null: Freeze, PhantomData<Value>: Freeze, PhantomData<String>: Freeze, PhantomData<ChainStep<()>>: Freeze, PhantomData<ChainStep<ArithmeticComputation>>: Freeze, *const ParentType is !null: Freeze, PhantomData<ParentType>: Freeze, PhantomData<ExprId>: Freeze, PhantomData<(Reference, ExprId)>: Freeze, PhantomData<Reference>: Freeze,

§

impl Move for ExpressionKind

§

impl RefUnwindSafe for ExpressionKind

§

impl Send for ExpressionKind
where RawVecInner: Send, BoxRaw<Value>: Send, Arc<PathBuf>: Send, BoxRaw<ParentType>: Send,

§

impl Sync for ExpressionKind
where RawVecInner: Sync, BoxRaw<Value>: Sync, Arc<PathBuf>: Sync, BoxRaw<ParentType>: Sync,

§

impl Unpin for ExpressionKind
where *const u8 is !null: Unpin, Box<Value>: Unpin, Arc<PathBuf>: Unpin, Box<ParentType>: Unpin,

§

impl UnsafeUnpin for ExpressionKind

§

impl UnwindSafe for ExpressionKind
where RawVecInner: UnwindSafe, BoxRaw<Value>: UnwindSafe, Arc<PathBuf>: UnwindSafe, BoxRaw<ParentType>: UnwindSafe,

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.