Skip to main content

Engine

Trait Engine 

Source
pub trait Engine: Send + Sync {
    // Required methods
    fn state(&self) -> PipelineState;
    fn recent_events(&self, n: usize) -> Vec<PipelineEvent>;
    fn run_research<'life0, 'life1, 'async_trait>(
        &'life0 self,
        task: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn advance(&self) -> Result<PipelineState, String>;
}
Expand description

What the engine exposes over the API. Implemented by kova-core.

Required Methods§

Source

fn state(&self) -> PipelineState

The current pipeline state row.

Source

fn recent_events(&self, n: usize) -> Vec<PipelineEvent>

The last n pipeline events, oldest first.

Source

fn run_research<'life0, 'life1, 'async_trait>( &'life0 self, task: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Run one Research task to completion and return a JSON summary.

Source

fn advance(&self) -> Result<PipelineState, String>

Advance the pipeline to the next phase, or error when the current status is not ReadyToAdvance or the phase is already final.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§