pub struct StatePersistence { /* private fields */ }Expand description
State persistence manager.
Implementations§
Source§impl StatePersistence
impl StatePersistence
Sourcepub async fn save(&self, state: &WorkflowState) -> Result<()>
pub async fn save(&self, state: &WorkflowState) -> Result<()>
Save workflow state to disk.
Sourcepub async fn load(&self, execution_id: &str) -> Result<WorkflowState>
pub async fn load(&self, execution_id: &str) -> Result<WorkflowState>
Load workflow state from disk.
Sourcepub async fn save_checkpoint(
&self,
checkpoint: &WorkflowCheckpoint,
) -> Result<()>
pub async fn save_checkpoint( &self, checkpoint: &WorkflowCheckpoint, ) -> Result<()>
Save a workflow checkpoint (state + DAG) to disk.
Sourcepub async fn load_checkpoint(
&self,
execution_id: &str,
) -> Result<WorkflowCheckpoint>
pub async fn load_checkpoint( &self, execution_id: &str, ) -> Result<WorkflowCheckpoint>
Load the latest checkpoint for an execution.
Sourcepub async fn load_checkpoint_by_sequence(
&self,
execution_id: &str,
sequence: u64,
) -> Result<WorkflowCheckpoint>
pub async fn load_checkpoint_by_sequence( &self, execution_id: &str, sequence: u64, ) -> Result<WorkflowCheckpoint>
Load a specific checkpoint by sequence number.
Sourcepub async fn delete_checkpoint(
&self,
execution_id: &str,
sequence: u64,
) -> Result<()>
pub async fn delete_checkpoint( &self, execution_id: &str, sequence: u64, ) -> Result<()>
Delete a checkpoint.
Sourcepub async fn delete_all_checkpoints(&self, execution_id: &str) -> Result<()>
pub async fn delete_all_checkpoints(&self, execution_id: &str) -> Result<()>
Delete all checkpoints for an execution.
Sourcepub async fn list_checkpoints(&self, execution_id: &str) -> Result<Vec<u64>>
pub async fn list_checkpoints(&self, execution_id: &str) -> Result<Vec<u64>>
List all checkpoints for an execution (sorted by sequence).
Sourcepub async fn checkpoint_exists(&self, execution_id: &str) -> bool
pub async fn checkpoint_exists(&self, execution_id: &str) -> bool
Check if a checkpoint exists for an execution.
Auto Trait Implementations§
impl Freeze for StatePersistence
impl RefUnwindSafe for StatePersistence
impl Send for StatePersistence
impl Sync for StatePersistence
impl Unpin for StatePersistence
impl UnsafeUnpin for StatePersistence
impl UnwindSafe for StatePersistence
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more