pub enum LogicalExpression {
Show 18 variants
Literal(Value),
Variable(String),
Property {
variable: String,
property: String,
},
Binary {
left: Box<LogicalExpression>,
op: BinaryOp,
right: Box<LogicalExpression>,
},
Unary {
op: UnaryOp,
operand: Box<LogicalExpression>,
},
FunctionCall {
name: String,
args: Vec<LogicalExpression>,
},
List(Vec<LogicalExpression>),
Map(Vec<(String, LogicalExpression)>),
IndexAccess {
base: Box<LogicalExpression>,
index: Box<LogicalExpression>,
},
SliceAccess {
base: Box<LogicalExpression>,
start: Option<Box<LogicalExpression>>,
end: Option<Box<LogicalExpression>>,
},
Case {
operand: Option<Box<LogicalExpression>>,
when_clauses: Vec<(LogicalExpression, LogicalExpression)>,
else_clause: Option<Box<LogicalExpression>>,
},
Parameter(String),
Labels(String),
Type(String),
Id(String),
ListComprehension {
variable: String,
list_expr: Box<LogicalExpression>,
filter_expr: Option<Box<LogicalExpression>>,
map_expr: Box<LogicalExpression>,
},
ExistsSubquery(Box<LogicalOperator>),
CountSubquery(Box<LogicalOperator>),
}Expand description
A logical expression.
Variants§
Literal(Value)
A literal value.
Variable(String)
A variable reference.
Property
Property access (e.g., n.name).
Binary
Binary operation.
Unary
Unary operation.
FunctionCall
Function call.
List(Vec<LogicalExpression>)
List literal.
Map(Vec<(String, LogicalExpression)>)
Map literal (e.g., {name: ‘Alice’, age: 30}).
IndexAccess
Index access (e.g., list[0]).
Fields
base: Box<LogicalExpression>The base expression (typically a list or string).
index: Box<LogicalExpression>The index expression.
SliceAccess
Slice access (e.g., list[1..3]).
Fields
base: Box<LogicalExpression>The base expression (typically a list or string).
start: Option<Box<LogicalExpression>>Start index (None means from beginning).
end: Option<Box<LogicalExpression>>End index (None means to end).
Case
CASE expression.
Fields
operand: Option<Box<LogicalExpression>>Test expression (for simple CASE).
when_clauses: Vec<(LogicalExpression, LogicalExpression)>WHEN clauses.
else_clause: Option<Box<LogicalExpression>>ELSE clause.
Parameter(String)
Parameter reference.
Labels(String)
Labels of a node.
Type(String)
Type of an edge.
Id(String)
ID of a node or edge.
ListComprehension
List comprehension: [x IN list WHERE predicate | expression]
Fields
list_expr: Box<LogicalExpression>The source list expression.
filter_expr: Option<Box<LogicalExpression>>Optional filter predicate.
map_expr: Box<LogicalExpression>The mapping expression for each element.
ExistsSubquery(Box<LogicalOperator>)
EXISTS subquery.
CountSubquery(Box<LogicalOperator>)
COUNT subquery.
Trait Implementations§
Source§impl Clone for LogicalExpression
impl Clone for LogicalExpression
Source§fn clone(&self) -> LogicalExpression
fn clone(&self) -> LogicalExpression
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more