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>,
distinct: bool,
},
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.
Fields
args: Vec<LogicalExpression>Arguments.
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 moreAuto Trait Implementations§
impl Freeze for LogicalExpression
impl RefUnwindSafe for LogicalExpression
impl Send for LogicalExpression
impl Sync for LogicalExpression
impl Unpin for LogicalExpression
impl UnsafeUnpin for LogicalExpression
impl UnwindSafe for LogicalExpression
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