Skip to main content

AlgorithmProvider

Trait AlgorithmProvider 

Source
pub trait AlgorithmProvider: Send + Sync {
    // Required methods
    fn signature(&self) -> &AlgorithmSignature;
    fn run(
        &self,
        ctx: AlgorithmContext<'_>,
    ) -> Result<SendableRecordBatchStream, FnError>;
}
Expand description

A black-box graph algorithm.

The trait is intentionally minimal: a signature describing the output, plus a run method returning a streaming RecordBatch sequence. The algorithm is responsible for fetching graph data via host APIs (out of scope of this trait — uni-algo will provide a GraphView abstraction the host adapter passes via AlgorithmContext once those APIs are available).

Required Methods§

Source

fn signature(&self) -> &AlgorithmSignature

Static signature.

Source

fn run( &self, ctx: AlgorithmContext<'_>, ) -> Result<SendableRecordBatchStream, FnError>

Execute the algorithm.

§Errors

Returns FnError if the algorithm cannot be started; per-batch failures are signaled via Err items in the returned stream.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§