Skip to main content

IrExpr

Enum IrExpr 

Source
pub enum IrExpr {
    Literal(IrLiteral),
    VarRef(VarId),
    PropertyAccess {
        base: ExprId,
        prop: PropId,
    },
    BinaryOp {
        op: BinaryOpKind,
        left: ExprId,
        right: ExprId,
    },
    UnaryOp {
        op: UnaryOpKind,
        expr: ExprId,
    },
    FunctionCall {
        name: String,
        args: Vec<ExprId>,
    },
    Parameter(String),
    Case {
        operand: Option<ExprId>,
        arms: Vec<CaseArm>,
        else_expr: Option<ExprId>,
    },
    ListLiteral(Vec<ExprId>),
    MapLiteral(Vec<(String, ExprId)>),
    Quantifier {
        kind: QuantifierKind,
        loop_var: VarId,
        list: ExprId,
        predicate: ExprId,
    },
    ListComprehension {
        loop_var: VarId,
        list: ExprId,
        filter: Option<ExprId>,
        projection: Option<ExprId>,
    },
}
Expand description

A single node in the ExprArena.

Every ExprId child is an index into the same arena; the arena owns all nodes and is the authoritative source of truth for expression structure.

Variants§

§

Literal(IrLiteral)

A scalar constant.

§

VarRef(VarId)

A reference to a pattern variable (e.g. n in MATCH (n:Person)).

§

PropertyAccess

A property read: base.prop.

Fields

§base: ExprId

The expression whose property is read.

§prop: PropId

The property type ID (resolved by the binder).

§

BinaryOp

A binary infix expression.

Fields

§op: BinaryOpKind

The operator.

§left: ExprId

Left-hand operand.

§right: ExprId

Right-hand operand.

§

UnaryOp

A unary prefix expression.

Fields

§op: UnaryOpKind

The operator.

§expr: ExprId

The operand.

§

FunctionCall

A built-in or user-defined function call.

Fields

§name: String

Fully-qualified function name (e.g. "toUpper", "apoc.text.join").

§args: Vec<ExprId>

Argument expressions.

§

Parameter(String)

A named query parameter (e.g. $name).

§

Case

A CASE expression.

Fields

§operand: Option<ExprId>

Simple-CASE operand; None for searched CASE.

§arms: Vec<CaseArm>

The WHEN/THEN arms.

§else_expr: Option<ExprId>

The ELSE expression, if present.

§

ListLiteral(Vec<ExprId>)

A list literal: [e0, e1, …].

§

MapLiteral(Vec<(String, ExprId)>)

A map literal: {k0: e0, k1: e1, …}.

Keys are plain strings; values are ExprId references.

§

Quantifier

A quantifier predicate all/any/none/single(loop_var IN list WHERE pred). loop_var is bound (only) within predicate. (#955)

Fields

§kind: QuantifierKind

Which quantifier (all/any/none/single).

§loop_var: VarId

The loop variable bound per element while evaluating predicate.

§list: ExprId

The list expression iterated over.

§predicate: ExprId

The per-element predicate.

§

ListComprehension

A list comprehension [loop_var IN list WHERE filter | projection]. loop_var is bound (only) within filter and projection. Either of filter/projection may be absent (a bare [x IN list] is the list itself; [x IN list WHERE p] filters; [x IN list | e] maps). (#955)

Fields

§loop_var: VarId

The loop variable bound per element while evaluating the clauses.

§list: ExprId

The list expression iterated over.

§filter: Option<ExprId>

Optional per-element filter; only elements where it is true are kept.

§projection: Option<ExprId>

Optional per-element projection; absent ⇒ the element itself.

Trait Implementations§

Source§

impl Clone for IrExpr

Source§

fn clone(&self) -> IrExpr

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 IrExpr

Source§

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

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

impl<'de> Deserialize<'de> for IrExpr

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for IrExpr

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for IrExpr

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for IrExpr

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.