pub trait StateStore: Send + Sync {
// Required methods
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 WorkflowState,
) -> Pin<Box<dyn Future<Output = Result<(), WorkflowError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
instance_id: &'life1 WorkflowId,
) -> Pin<Box<dyn Future<Output = Result<WorkflowState, WorkflowError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
instance_id: &'life1 WorkflowId,
) -> Pin<Box<dyn Future<Output = Result<(), WorkflowError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<WorkflowId>, WorkflowError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_by_status<'life0, 'async_trait>(
&'life0 self,
status: WorkflowStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<WorkflowId>, WorkflowError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn cleanup<'life0, 'async_trait>(
&'life0 self,
retention: Duration,
) -> Pin<Box<dyn Future<Output = Result<u64, WorkflowError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait for workflow state persistence
Required Methods§
Sourcefn save<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 WorkflowState,
) -> Pin<Box<dyn Future<Output = Result<(), WorkflowError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 WorkflowState,
) -> Pin<Box<dyn Future<Output = Result<(), WorkflowError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save workflow state
Sourcefn load<'life0, 'life1, 'async_trait>(
&'life0 self,
instance_id: &'life1 WorkflowId,
) -> Pin<Box<dyn Future<Output = Result<WorkflowState, WorkflowError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
instance_id: &'life1 WorkflowId,
) -> Pin<Box<dyn Future<Output = Result<WorkflowState, WorkflowError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load workflow state
Sourcefn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
instance_id: &'life1 WorkflowId,
) -> Pin<Box<dyn Future<Output = Result<(), WorkflowError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
instance_id: &'life1 WorkflowId,
) -> Pin<Box<dyn Future<Output = Result<(), WorkflowError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete workflow state
Sourcefn list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<WorkflowId>, WorkflowError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<WorkflowId>, WorkflowError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all workflow instances
Sourcefn list_by_status<'life0, 'async_trait>(
&'life0 self,
status: WorkflowStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<WorkflowId>, WorkflowError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_by_status<'life0, 'async_trait>(
&'life0 self,
status: WorkflowStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<WorkflowId>, WorkflowError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List workflow instances by status