pub enum Expr {
Show 27 variants
Literal(CypherLiteral),
Parameter(String),
Variable(String),
Wildcard,
Property(Box<Expr>, String),
List(Vec<Expr>),
Map(Vec<(String, Expr)>),
FunctionCall {
name: String,
args: Vec<Expr>,
distinct: bool,
window_spec: Option<WindowSpec>,
},
BinaryOp {
left: Box<Expr>,
op: BinaryOp,
right: Box<Expr>,
},
UnaryOp {
op: UnaryOp,
expr: Box<Expr>,
},
Case {
expr: Option<Box<Expr>>,
when_then: Vec<(Expr, Expr)>,
else_expr: Option<Box<Expr>>,
},
Exists {
query: Box<Query>,
from_pattern_predicate: bool,
},
CountSubquery(Box<Query>),
CollectSubquery(Box<Query>),
IsNull(Box<Expr>),
IsNotNull(Box<Expr>),
IsUnique(Box<Expr>),
In {
expr: Box<Expr>,
list: Box<Expr>,
},
ArrayIndex {
array: Box<Expr>,
index: Box<Expr>,
},
ArraySlice {
array: Box<Expr>,
start: Option<Box<Expr>>,
end: Option<Box<Expr>>,
},
Quantifier {
quantifier: Quantifier,
variable: String,
list: Box<Expr>,
predicate: Box<Expr>,
},
Reduce {
accumulator: String,
init: Box<Expr>,
variable: String,
list: Box<Expr>,
expr: Box<Expr>,
},
ListComprehension {
variable: String,
list: Box<Expr>,
where_clause: Option<Box<Expr>>,
map_expr: Box<Expr>,
},
PatternComprehension {
path_variable: Option<String>,
pattern: Pattern,
where_clause: Option<Box<Expr>>,
map_expr: Box<Expr>,
},
ValidAt {
entity: Box<Expr>,
timestamp: Box<Expr>,
start_prop: Option<String>,
end_prop: Option<String>,
},
MapProjection {
base: Box<Expr>,
items: Vec<MapProjectionItem>,
},
LabelCheck {
expr: Box<Expr>,
labels: Vec<String>,
},
}Variants§
Literal(CypherLiteral)
Parameter(String)
Variable(String)
Wildcard
Property(Box<Expr>, String)
List(Vec<Expr>)
Map(Vec<(String, Expr)>)
FunctionCall
BinaryOp
UnaryOp
Case
Exists
Fields
CountSubquery(Box<Query>)
CollectSubquery(Box<Query>)
IsNull(Box<Expr>)
IsNotNull(Box<Expr>)
IsUnique(Box<Expr>)
In
ArrayIndex
ArraySlice
Quantifier
Reduce
ListComprehension
PatternComprehension
Fields
ValidAt
MapProjection
LabelCheck
Label check expression: a:B or conjunctive a:A:B
Implementations§
Source§impl Expr
impl Expr
Sourcepub const TRUE: Expr
pub const TRUE: Expr
Sentinel expression representing a literal true.
Useful in the planner for predicate reduction: when all conjuncts have been pushed down, the remaining predicate is replaced with this constant.
Sourcepub fn is_true_literal(&self) -> bool
pub fn is_true_literal(&self) -> bool
Returns true if this expression is the literal boolean true.
Sourcepub fn extract_variable(&self) -> Option<String>
pub fn extract_variable(&self) -> Option<String>
Extract a simple variable name if this expression is just a variable reference
Sourcepub fn substitute_variable(&self, old_var: &str, new_var: &str) -> Expr
pub fn substitute_variable(&self, old_var: &str, new_var: &str) -> Expr
Substitute all occurrences of a variable with a new variable name.
Structural variants (no binders, no special-case items) delegate to
map_children, which is the canonical place where the full Expr
variant set is enumerated. Only the variants with non-mechanical
behavior — the matching Variable, variable-binders that introduce
shadowing (Quantifier, Reduce, ListComprehension,
PatternComprehension), and MapProjection whose Variable
projection items must be rewritten — get explicit arms.
Sourcepub fn is_aggregate(&self) -> bool
pub fn is_aggregate(&self) -> bool
Check if this expression contains an aggregate function
Sourcepub fn to_string_repr(&self) -> String
pub fn to_string_repr(&self) -> String
Generate a string representation of this expression for debugging/display
Sourcepub fn for_each_child(&self, f: &mut dyn FnMut(&Expr))
pub fn for_each_child(&self, f: &mut dyn FnMut(&Expr))
Call f on each direct child expression (non-recursive).
Does NOT descend into subqueries (Exists, CountSubquery, CollectSubquery) since those have separate variable scope.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Expr
impl<'de> Deserialize<'de> for Expr
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>,
impl StructuralPartialEq for Expr
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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