Skip to main content

ProcedureProvider

Trait ProcedureProvider 

Source
pub trait ProcedureProvider: Send + Sync {
    // Required methods
    fn signature(&self, name: &str) -> Option<ProcedureSignature>;
    fn call(
        &self,
        name: &str,
        args: &[Value],
    ) -> Result<Vec<Vec<Value>>, QueryError>;
}
Expand description

Implemented by whatever embeds MarsDB to make CALL resolve to real behavior. Executor calls signature once per CALL (for compile- time-shaped validation) and call once per input row (standalone: once total, since there’s no input row to iterate).

Required Methods§

Source

fn signature(&self, name: &str) -> Option<ProcedureSignature>

None means “no such procedure” – Executor reports this as a ProcedureError/ProcedureNotFound-flavored QueryError (no dedicated QueryError variant for this taxonomy — see CYPHER_COVERAGE.md’s own error-taxonomy scope note; any error is enough for TCK’s coarse checking).

Source

fn call( &self, name: &str, args: &[Value], ) -> Result<Vec<Vec<Value>>, QueryError>

args is already fully evaluated and type-checked against signature(name)’s input_types, in declared-input order. Returns the procedure’s output rows, each with exactly signature(name)’s outputs.len() values in that same order – Executor never inspects a row’s shape beyond that, so how a provider produces them (a fixed lookup table, real computation, …) is entirely up to it.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§