pub struct PathPattern {
pub variable: Option<SmallName>,
pub subpath_variable: Option<SmallName>,
pub elements: Vec<PatternElement>,
pub nodes: Vec<NodePattern>,
pub rels: Vec<RelPattern>,
pub where_clause: Option<Box<Expr>>,
pub mode: Option<PathMode>,
pub selector: Option<PathSelector>,
pub is_shortest_path_function: bool,
}Fields§
§variable: Option<SmallName>Named path: MATCH p = (a)-[]->(b).
subpath_variable: Option<SmallName>A second name bound to the same path value when the path’s whole body
is a named parenthesized group (MATCH p = ANY SHORTEST (q = (a)-[]->(b))). The executor binds it beside Self::variable.
elements: Vec<PatternElement>Lossless GPM element sequence. Empty only for legacy callers that
construct the compact nodes/rels representation directly.
nodes: Vec<NodePattern>§rels: Vec<RelPattern>§where_clause: Option<Box<Expr>>§mode: Option<PathMode>§selector: Option<PathSelector>§is_shortest_path_function: boolImplementations§
Source§impl PathPattern
impl PathPattern
Sourcepub fn node_reuses_binding(&self, np: &NodePattern) -> bool
pub fn node_reuses_binding(&self, np: &NodePattern) -> bool
Whether node np of this CREATE/MERGE path is a reference to an
existing binding of its name instead of a fresh declaration. Only a
bare variable beside a relationship reuses ((a)-[:R]->(b), the
openCypher (n)-[:R]->(n) rows); a standalone node, or one that adds
labels or properties, declares — and when an enclosing scope bound
the name (a FOREACH body), the declaration shadows it. The one rule
the planner’s CREATE binder and the executor’s materializer share.
Sourcepub fn path_names(&self) -> impl Iterator<Item = &SmallName>
pub fn path_names(&self) -> impl Iterator<Item = &SmallName>
The names this pattern binds its path value under, in declaration order: the outer path variable, then a named parenthesized subpath. The one enumeration every binder, scope walk and variable collector consults — the two names name the same path value.
Sourcepub fn boundary_nodes(&self) -> Option<(&NodePattern, &NodePattern)>
pub fn boundary_nodes(&self) -> Option<(&NodePattern, &NodePattern)>
The pattern’s boundary node patterns: the first and last elements,
when both are nodes. The one endpoint read every boundary consumer
(the frontier compile, the shortest-path static common-end rule)
consults; None for any other element sequence.
Sourcepub fn relationship_variables(&self) -> impl Iterator<Item = &SmallName>
pub fn relationship_variables(&self) -> impl Iterator<Item = &SmallName>
Every relationship variable the pattern binds, in element order,
recursing into quantified groups. Both views are consulted: the
compact rels view retains a var-length relationship’s name, while
the GPM elements view quantifies it.
Sourcepub fn has_path_name(&self) -> bool
pub fn has_path_name(&self) -> bool
Whether the pattern binds a path value under any of its names (the outer path variable or a named parenthesized subpath).
Sourcepub fn has_compact_alternating_elements(&self) -> bool
pub fn has_compact_alternating_elements(&self) -> bool
Whether nodes/rels and elements are in 1-to-1 alternating
correspondence (no quantified elements, no path mode, selector, or
path-level WHERE). True for plain patterns and for fixed-length
patterns whose only GPM feature is inline node/relationship WHERE
predicates — allowing WHERE folding and orientation reversal while
keeping nodes/rels and elements in sync.
Sourcepub fn needs_gpm(&self) -> bool
pub fn needs_gpm(&self) -> bool
Whether this path must be matched by the GPM engine rather than the
compact node/rel walker: either the compact nodes/rels
representation was cleared at lowering (non-alternating or quantified
element sequence), or GPM-only features are present (path mode, path
selector, path-level or element-level predicates).
Source§impl PathPattern
impl PathPattern
Sourcepub fn whole_population_node(&self) -> Option<WholePopulationNode<'_>>
pub fn whole_population_node(&self) -> Option<WholePopulationNode<'_>>
The whole-population node of a one-node, relationship-free pattern
the compact walker owns (no Self::needs_gpm feature) whose node
is named and unconstrained. None
for an anonymous node and every other shape.