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) -> Result<Vec<ProcRow>>
pub fn resolve_rows(&self, reader: &dyn GraphReader) -> Result<Vec<ProcRow>>
Produce the row set the executor should iterate. Static
procedures simply hand back their pre-populated rows;
built-ins derive their rows from the live graph via reader.
Sourcepub fn resolve_write_rows(
&self,
reader: &dyn GraphReader,
writer: &dyn GraphWriter,
args: &[Value],
) -> Result<Vec<ProcRow>>
pub fn resolve_write_rows( &self, reader: &dyn GraphReader, writer: &dyn GraphWriter, args: &[Value], ) -> 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.