Skip to main content

ProcedurePlugin

Trait ProcedurePlugin 

Source
pub trait ProcedurePlugin: Send + Sync {
    // Required methods
    fn signature(&self) -> &ProcedureSignature;
    fn invoke(
        &self,
        ctx: ProcedureContext<'_>,
        args: &[ColumnarValue],
    ) -> Result<SendableRecordBatchStream, FnError>;
}
Expand description

A Cypher procedure plugin — CALL uni.foo.bar(args) YIELD ....

Procedures return a stream of RecordBatches; the host attaches the stream to the surrounding query plan via a ProcedureCallExec node.

Required Methods§

Source

fn signature(&self) -> &ProcedureSignature

Static signature.

Source

fn invoke( &self, ctx: ProcedureContext<'_>, args: &[ColumnarValue], ) -> Result<SendableRecordBatchStream, FnError>

Invoke the procedure with the given arguments and execution context.

The returned stream is consumed lazily by downstream YIELD. The procedure is responsible for cooperatively yielding to the executor (no long blocking calls; use tokio::task::yield_now between batches).

§Errors

Returns FnError if the procedure cannot start (validation failure, capability check). Errors raised during stream production are signaled via Err items in the stream.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§