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
impl Procedure
Sourcepub fn row_matches(&self, row: &ProcRow, args: &[Value]) -> bool
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.
Sourcepub fn is_write_builtin(&self) -> bool
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.
Sourcepub fn resolve_rows(
&self,
reader: &dyn GraphReader,
args: &[Value],
procedures: &ProcedureRegistry,
) -> Result<ProcRows>
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.
Sourcepub fn resolve_write_rows(
&self,
reader: &dyn GraphReader,
writer: &dyn GraphWriter,
args: &[Value],
procedures: &ProcedureRegistry,
) -> Result<Vec<ProcRow>>
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.