Skip to main content

PathPattern

Struct PathPattern 

Source
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: bool

Implementations§

Source§

impl PathPattern

Source

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.

Source

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.

Source

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.

Source

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.

Source

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).

Source

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.

Source

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

Source

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.

Trait Implementations§

Source§

impl Clone for PathPattern

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PathPattern

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for PathPattern

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PathPattern

Auto Trait Implementations§

§

impl Forget for PathPattern

§

impl Freeze for PathPattern

§

impl Move for PathPattern

§

impl RefUnwindSafe for PathPattern

§

impl Send for PathPattern
where Arc<str>: Send, RawVecInner: Send, BoxRaw<Expr>: Send, BoxRaw<LabelExpr>: Send, Arc<Vec<Value>>: Send, Arc<BTreeMap<String, Value>>: Send, Arc<Node>: Send, Arc<Relationship>: Send, Arc<Path>: Send, NonZero<i32>: Send, BoxRaw<CivilZonedFields>: Send, Arc<[f32]>: Send, Arc<[f64]>: Send, Arc<[i64]>: Send, Arc<[u8]>: Send, BoxRaw<TypeExpr>: Send, BoxRaw<Clause>: Send, BoxRaw<SearchClause>: Send, BoxRaw<Query>: Send,

§

impl Sync for PathPattern
where Arc<str>: Sync, RawVecInner: Sync, BoxRaw<Expr>: Sync, BoxRaw<LabelExpr>: Sync, Arc<Vec<Value>>: Sync, Arc<BTreeMap<String, Value>>: Sync, Arc<Node>: Sync, Arc<Relationship>: Sync, Arc<Path>: Sync, NonZero<i32>: Sync, BoxRaw<CivilZonedFields>: Sync, Arc<[f32]>: Sync, Arc<[f64]>: Sync, Arc<[i64]>: Sync, Arc<[u8]>: Sync, BoxRaw<TypeExpr>: Sync, BoxRaw<Clause>: Sync, BoxRaw<SearchClause>: Sync, BoxRaw<Query>: Sync,

§

impl Unpin for PathPattern

§

impl UnsafeUnpin for PathPattern

§

impl UnwindSafe for PathPattern

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.