Skip to main content

PatternPath

Struct PatternPath 

Source
pub struct PatternPath {
    pub variable: Option<SmallName>,
    pub subpath_variable: Option<SmallName>,
    pub elements: Vec<PatternElement>,
    pub where_expr: Option<Expr>,
    pub mode: Option<PathMode>,
    pub selector: Option<PathSelector>,
    pub is_shortest_path_function: bool,
}
Expand description

A path pattern like (a)-[r]->(b), optionally named: p = (a)-[r]->(b).

Fields§

§variable: Option<SmallName>§subpath_variable: Option<SmallName>

CIP-73: the subpath variable of a named parenthesized group that is itself the whole path body (MATCH p = ANY SHORTEST (q = (:A)-->+(:B)), MATCH ANY SHORTEST (q = (:A)-->+(:B))). Self::variable carries only the enclosing p = … name; both names bind the same path value and Self::path_names lists them. A lone group name (no enclosing path name) stays here, not in variable, so a group reading its own name inside its WHERE stays distinguishable from an enclosing path variable read there (42I21).

§elements: Vec<PatternElement>§where_expr: Option<Expr>

The trailing WHERE of a parenthesized path pattern, e.g. ((n)-[r]->(m) WHERE n.p > m.q AND r:S) (CIP-14 “parenthesized path pattern” location). Evaluated once every element in the path is bound, ANDed with the pattern match itself.

§mode: Option<PathMode>

CIP-51 explicit path mode prefix (WALK/TRAIL/ACYCLIC/SIMPLE), written directly or nested inside a selector’s own [path mode] slot. None means no explicit keyword (resolves to Walk).

§selector: Option<PathSelector>

CIP-73/CIP-191 path selector prefix (ALL/ANY/SHORTEST/…). None means no explicit selector (equivalent to an implicit ALL).

§is_shortest_path_function: bool

True if this path pattern is sugar for the pre-GPM shortestPath(...)/allShortestPaths(...) function (CIP-40/CIP-73), rather than an explicit SHORTEST/ALL SHORTEST selector keyword – even though both normalize to the same selector value. The two are NOT interchangeable for CIP-40’s mixing rules: the legacy function forms are exempt from the explicit-match-mode and multiple-selective-path-pattern restrictions that apply to the keyword selector syntax (see Parser::parse_match).

Implementations§

Source§

impl PatternPath

Source

pub fn path_names(&self) -> impl Iterator<Item = &SmallName>

The names this path binds its path value under, in declaration order: the outer path variable, then a named parenthesized subpath. The two name the same path value; the IR twin is PathPattern::path_names.

Trait Implementations§

Source§

impl Clone for PatternPath

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 PatternPath

Source§

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

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

impl PartialEq for PatternPath

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 PatternPath

Auto Trait Implementations§

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.