pub enum Expression {
Show 16 variants
Property {
variable: String,
property: String,
},
Literal(PropertyValue),
Binary {
left: Box<Expression>,
op: BinaryOp,
right: Box<Expression>,
},
Unary {
op: UnaryOp,
expr: Box<Expression>,
},
Function {
name: String,
args: Vec<Expression>,
distinct: bool,
},
Variable(String),
Case {
operand: Option<Box<Expression>>,
when_clauses: Vec<(Expression, Expression)>,
else_result: Option<Box<Expression>>,
},
Index {
expr: Box<Expression>,
index: Box<Expression>,
},
ListSlice {
expr: Box<Expression>,
start: Option<Box<Expression>>,
end: Option<Box<Expression>>,
},
ExistsSubquery {
pattern: Pattern,
where_clause: Option<Box<WhereClause>>,
},
ListComprehension {
variable: String,
list_expr: Box<Expression>,
filter: Option<Box<Expression>>,
map_expr: Box<Expression>,
},
PredicateFunction {
name: String,
variable: String,
list_expr: Box<Expression>,
predicate: Box<Expression>,
},
Reduce {
accumulator: String,
init: Box<Expression>,
variable: String,
list_expr: Box<Expression>,
expression: Box<Expression>,
},
PatternComprehension {
pattern: Pattern,
filter: Option<Box<Expression>>,
projection: Box<Expression>,
},
PathVariable(String),
Parameter(String),
}Expand description
Expression in WHERE or RETURN
Variants§
Property
Property access: n.name
Literal(PropertyValue)
Literal value
Binary
Binary operation
Unary
Unary operation
Function
Function call
Fields
args: Vec<Expression>Function arguments
Variable(String)
Variable reference
Case
CASE expression
Fields
operand: Option<Box<Expression>>Optional operand for simple CASE
when_clauses: Vec<(Expression, Expression)>WHEN condition THEN result pairs
else_result: Option<Box<Expression>>ELSE default
Index
List/map indexing: expr[index]
ListSlice
List slicing: expr[start..end]
Fields
expr: Box<Expression>Expression being sliced
start: Option<Box<Expression>>Optional start index (inclusive)
end: Option<Box<Expression>>Optional end index (exclusive)
ExistsSubquery
EXISTS { MATCH pattern WHERE condition }
Fields
where_clause: Option<Box<WhereClause>>Optional WHERE predicate
ListComprehension
List comprehension: [x IN list WHERE cond | expr]
Fields
list_expr: Box<Expression>List expression
filter: Option<Box<Expression>>Optional filter predicate
map_expr: Box<Expression>Mapping expression
PredicateFunction
Predicate function: all(x IN list WHERE pred), any(…), none(…), single(…)
Reduce
reduce(acc = init, x IN list | expr)
Fields
init: Box<Expression>Initial value expression
list_expr: Box<Expression>List expression
expression: Box<Expression>Body expression
PatternComprehension
Pattern comprehension: [(a)-[:REL]->(b) WHERE cond | expr]
Fields
filter: Option<Box<Expression>>Optional filter predicate
projection: Box<Expression>Projection expression
PathVariable(String)
Named path reference (for Value::Path)
Parameter(String)
Query parameter reference ($name)
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Expression
impl Debug for Expression
Source§impl PartialEq for Expression
impl PartialEq for Expression
impl StructuralPartialEq for Expression
Auto Trait Implementations§
impl Freeze for Expression
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnsafeUnpin for Expression
impl UnwindSafe for Expression
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> 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