Skip to main content

StateAdapter

Trait StateAdapter 

Source
pub trait StateAdapter: Send + Sync {
    // Required methods
    fn save_workflow_run<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        workflow_run: &'life1 WorkflowRun,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn apply_workflow_run_diff<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        diff: &'life1 WorkflowRunDiff,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_workflow_run<'life0, 'async_trait>(
        &'life0 self,
        workflow_run_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<WorkflowRun>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_workflow_runs<'life0, 'async_trait>(
        &'life0 self,
        limit: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<WorkflowRun>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn save_task<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        task: &'life1 Task,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn apply_task_diff<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        diff: &'life1 TaskDiff,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_task<'life0, 'async_trait>(
        &'life0 self,
        task_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Task>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_tasks<'life0, 'async_trait>(
        &'life0 self,
        workflow_run_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Task>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_state<'life0, 'async_trait>(
        &'life0 mut self,
        workflow_run_id: Uuid,
        state: HashMap<String, Value>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn apply_state_diff<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        diff: &'life1 StateDiff,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_state<'life0, 'async_trait>(
        &'life0 self,
        workflow_run_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Value>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

State adapter trait for persisting workflow state

Required Methods§

Source

fn save_workflow_run<'life0, 'life1, 'async_trait>( &'life0 mut self, workflow_run: &'life1 WorkflowRun, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save a workflow run

Source

fn apply_workflow_run_diff<'life0, 'life1, 'async_trait>( &'life0 mut self, diff: &'life1 WorkflowRunDiff, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Apply a diff to a workflow run

Source

fn get_workflow_run<'life0, 'async_trait>( &'life0 self, workflow_run_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<WorkflowRun>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get a workflow run

Source

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

List workflow runs

Source

fn save_task<'life0, 'life1, 'async_trait>( &'life0 mut self, task: &'life1 Task, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save a task

Source

fn apply_task_diff<'life0, 'life1, 'async_trait>( &'life0 mut self, diff: &'life1 TaskDiff, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Apply a diff to a task

Source

fn get_task<'life0, 'async_trait>( &'life0 self, task_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Task>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get a task

Source

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

Get all tasks for a workflow run

Source

fn update_state<'life0, 'async_trait>( &'life0 mut self, workflow_run_id: Uuid, state: HashMap<String, Value>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Update workflow state

Source

fn apply_state_diff<'life0, 'life1, 'async_trait>( &'life0 mut self, diff: &'life1 StateDiff, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Apply a diff to workflow state

Source

fn get_state<'life0, 'async_trait>( &'life0 self, workflow_run_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Value>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get workflow state

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§