Skip to main content

Procedure

Struct Procedure 

Source
pub struct Procedure {
    pub qualified_name: Vec<String>,
    pub inputs: Vec<ProcArgSpec>,
    pub outputs: Vec<ProcOutSpec>,
    pub rows: Vec<ProcRow>,
    pub builtin: Option<BuiltinProc>,
}
Expand description

A procedure registered with a ProcedureRegistry. The TCK harness builds one per And there exists a procedure ... step by collating the signature and the gherkin data table: each data row contributes one entry to rows where the leading cells are the input-column values (matched against call arguments) and the trailing cells are the output-column values (projected by YIELD).

Built-in procedures — db.labels() and friends — leave rows empty and set builtin so the executor materialises the row set live from the current graph via Procedure::resolve_rows.

Fields§

§qualified_name: Vec<String>§inputs: Vec<ProcArgSpec>§outputs: Vec<ProcOutSpec>§rows: Vec<ProcRow>§builtin: Option<BuiltinProc>

Implementations§

Source§

impl Procedure

Source

pub fn row_matches(&self, row: &ProcRow, args: &[Value]) -> bool

True when the call arguments match this row’s input columns. Applied per row during execution — rows whose input cells differ from the supplied arg values are filtered out. Argument-type coercion (FLOAT accepts an integer, etc.) is handled by the caller converting the call arg to the declared type before comparing here.

Source

pub fn is_write_builtin(&self) -> bool

True when this procedure mutates the store and therefore needs to be dispatched through Self::resolve_write_rows (which receives the writer and the already-evaluated args) rather than Self::resolve_rows. Read-only built-ins and pre-populated rows return false.

Source

pub fn resolve_rows( &self, reader: &dyn GraphReader, args: &[Value], procedures: &ProcedureRegistry, ) -> Result<ProcRows>

Produce the row source the executor should iterate. Static procedures simply hand back their pre-populated rows as Eager; built-ins with bounded output derive their rows from the live graph (still eager, but live). Streaming built-ins — path traversals, subgraph walks, apoc.load.* — hand back a cursor so the executor can pull lazily and short-circuit on downstream LIMIT. args carries the call arguments after type coercion; today’s eager builtins ignore them (their inputs are empty), but streaming cursors use them to seed traversal state. The procedure registry is threaded through so load cursors can read their ImportConfig at construction time; most built-ins ignore it.

Source

pub fn resolve_write_rows( &self, reader: &dyn GraphReader, writer: &dyn GraphWriter, args: &[Value], procedures: &ProcedureRegistry, ) -> Result<Vec<ProcRow>>

Write-procedure dispatch path. The args are already evaluated and type-checked; the row is produced as a side effect of the mutation (e.g. the newly-created node) so row_matches is skipped for these procedures. The procedure registry is threaded through for procedures (like apoc.cypher.doIt) that recurse into the executor and need to resolve nested CALL sites against the same set; most write built-ins ignore it.

Trait Implementations§

Source§

impl Clone for Procedure

Source§

fn clone(&self) -> Procedure

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Procedure

Source§

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

Formats the value using the given formatter. Read more

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more