pub enum Expr {
Lit(ExprLit),
Ref(String),
Unary(UnOp, Box<Expr>),
Binary(BinOp, Box<Expr>, Box<Expr>),
Call(Builtin, Vec<Expr>),
Field(Box<Expr>, String),
Index(Box<Expr>, Box<Expr>),
}Expand description
A pure, total expression in AXON’s closed-catalog expression sublanguage
(§Fase 70). Evaluates to a value with no side effects, no I/O, no recursion
and no unbounded loops — so it is decidable and const-foldable. Mounted as
the condition of an if (and, in later sub-fases, let values + where:
predicates). Field/index access and the builtin catalog land in §70.c/d.
Variants§
Lit(ExprLit)
A typed literal (42, 3.14, true, "hello").
Ref(String)
A reference to a binding or dotted path (x, User.tier).
Unary(UnOp, Box<Expr>)
A unary operation (-x, not x).
Binary(BinOp, Box<Expr>, Box<Expr>)
A binary operation (a + b, a >= b, a and b).
Call(Builtin, Vec<Expr>)
§Fase 70.c — a closed-catalog builtin call. args[0] is the receiver
(the value before the .); any further entries are the call arguments.
E.g. recent.length → Call(Length, [Ref("recent")]),
name.starts_with("Dr") → Call(StartsWith, [Ref("name"), Lit(Str)]).
Field(Box<Expr>, String)
§Fase 70.d — field access on a non-reference base (items[0].name,
(expr).field). A plain dotted path stays a Ref (a.b.c) for
back-compat; this node is the structured form the JSONB SQL lowering
(deferred §73) consumes. The String is the field name.
Index(Box<Expr>, Box<Expr>)
§Fase 70.d — index access base[index] (array element / string char).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
impl UnwindSafe for Expr
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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