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§
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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_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
Sourcefn 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 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
Sourcefn 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 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
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".