#[non_exhaustive]pub enum ReadOp {
Show 13 variants
Source {
label: Option<LabelSet>,
bind: VarId,
},
Expand {
input: OpId,
from: VarId,
rel: RelSpec,
to: NodeSpec,
bind_rel: VarId,
bind_to: VarId,
},
Filter {
input: OpId,
predicate: Expr,
},
Project {
input: OpId,
items: Vec<Projection>,
},
Aggregate {
input: OpId,
keys: Vec<Expr>,
aggs: Vec<AggExpr>,
},
OrderBy {
input: OpId,
keys: Vec<OrderKey>,
},
Skip {
input: OpId,
count: Expr,
},
Limit {
input: OpId,
count: Expr,
},
Distinct {
input: OpId,
},
Unwind {
input: OpId,
list: Expr,
bind: VarId,
},
Union {
left: OpId,
right: OpId,
kind: UnionKind,
},
With {
input: OpId,
items: Vec<Projection>,
filter: Option<Expr>,
},
OptionalJoin {
input: OpId,
pattern: Box<ReadOp>,
},
}Expand description
Logical read-plan operator tree. Spec §12.1.
Operators form a DAG — each variant that has an input field references
its source by OpId. The OptionalJoin variant embeds a sub-tree
directly via Box<ReadOp> because its inner pattern is always a fresh
tree introduced by OPTIONAL MATCH.
Consumers iterate the tree in whatever order suits their executor. This crate imposes no evaluation semantics.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Source
Scan all nodes, optionally filtered to those carrying a set of labels.
When label is None this is an all-node scan; when Some it is a
label-index scan (or filtered full scan, depending on the consumer’s
storage). Spec §12.1 N1.
Fields
Expand
Expand a node into its adjacent relationships and neighbour nodes.
Starting from from (already bound in input), traverse relationships
matching rel to reach a node matching to. Spec §12.1 N2.
Fields
Filter
Predicate filter — keeps only rows where predicate is truthy.
Implements WHERE and inline pattern predicates. Spec §12.1 N3.
Fields
Project
Column projection — renames / computes output columns.
Implements the output column list of RETURN and WITH.
Spec §12.1 N4.
Aggregate
Aggregation — groups rows and applies aggregate functions.
keys are the grouping expressions; aggs are the aggregate calls.
An empty keys vec aggregates the entire input into a single row.
Spec §12.1 N5.
Fields
OrderBy
Sort — orders rows by a list of sort keys. Spec §12.1 N6.
Skip
Skip — discards the first count rows. Spec §12.1 N7.
Fields
Limit
Limit — keeps only the first count rows. Spec §12.1 N8.
Distinct
Distinct — removes duplicate rows. Spec §12.1 N9.
Row equality is Cypher value equality (null != null).
Unwind
Unwind — flattens a list expression into one row per element.
Implements UNWIND list AS var. Spec §12.1 N10.
Fields
Union
Union — concatenates rows from two sub-plans. Spec §12.1 N11.
Fields
With
With — projects columns and optionally filters, resetting scope.
Implements the WITH clause. Differs from ReadOp::Project in
that WITH starts a new variable scope. Spec §12.1 N12.
Fields
items: Vec<Projection>Output columns.
OptionalJoin
Optional join — left-outer-join a sub-plan. Spec §12.1 N13.
Implements OPTIONAL MATCH. Rows from input that have no match in
pattern are kept with null-bound variables.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ReadOp
impl<'de> Deserialize<'de> for ReadOp
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
impl Eq for ReadOp
impl StructuralPartialEq for ReadOp
Auto Trait Implementations§
impl Freeze for ReadOp
impl RefUnwindSafe for ReadOp
impl Send for ReadOp
impl Sync for ReadOp
impl Unpin for ReadOp
impl UnsafeUnpin for ReadOp
impl UnwindSafe for ReadOp
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.