Skip to main content

RalphStateStore

Trait RalphStateStore 

Source
pub trait RalphStateStore: Send + Sync {
    // Required methods
    fn create_run<'life0, 'life1, 'async_trait>(
        &'life0 self,
        state: &'life1 RalphRunState,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn update_status<'life0, 'life1, 'async_trait>(
        &'life0 self,
        run_id: &'life1 str,
        status: RalphStatus,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn update_iteration<'life0, 'life1, 'async_trait>(
        &'life0 self,
        run_id: &'life1 str,
        iteration: usize,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn record_story_result<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        run_id: &'life1 str,
        result: &'life2 StoryResultEntry,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn append_progress<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        run_id: &'life1 str,
        entry: &'life2 ProgressEntry,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn update_prd<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        run_id: &'life1 str,
        prd: &'life2 Prd,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn set_error<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        run_id: &'life1 str,
        error: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn complete_run<'life0, 'life1, 'async_trait>(
        &'life0 self,
        run_id: &'life1 str,
        status: RalphStatus,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_run<'life0, 'life1, 'async_trait>(
        &'life0 self,
        run_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<RalphRunState>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_runs<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<RalphRunSummary>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Abstraction over Ralph run state persistence.

All methods are fire-and-forget from the caller’s perspective — implementations should log errors internally rather than failing the Ralph pipeline.

Required Methods§

Source

fn create_run<'life0, 'life1, 'async_trait>( &'life0 self, state: &'life1 RalphRunState, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create a new run record

Source

fn update_status<'life0, 'life1, 'async_trait>( &'life0 self, run_id: &'life1 str, status: RalphStatus, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update the run status

Source

fn update_iteration<'life0, 'life1, 'async_trait>( &'life0 self, run_id: &'life1 str, iteration: usize, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Record iteration progress

Source

fn record_story_result<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, run_id: &'life1 str, result: &'life2 StoryResultEntry, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Record a story result

Source

fn append_progress<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, run_id: &'life1 str, entry: &'life2 ProgressEntry, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Append a progress log entry

Source

fn update_prd<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, run_id: &'life1 str, prd: &'life2 Prd, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Update the PRD (e.g. after marking stories passed)

Source

fn set_error<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, run_id: &'life1 str, error: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Set error message

Source

fn complete_run<'life0, 'life1, 'async_trait>( &'life0 self, run_id: &'life1 str, status: RalphStatus, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Mark run as completed

Source

fn get_run<'life0, 'life1, 'async_trait>( &'life0 self, run_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<RalphRunState>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get full run state

Source

fn list_runs<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<RalphRunSummary>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all runs (summary only)

Implementors§