pub struct SnapshotStore { /* private fields */ }Expand description
Manages a series of snapshots for a workflow.
Implementations§
Source§impl SnapshotStore
impl SnapshotStore
Sourcepub fn new(workflow_id: impl Into<String>) -> Self
pub fn new(workflow_id: impl Into<String>) -> Self
Create a new snapshot store for the given workflow.
Sourcepub fn with_max_snapshots(self, max: usize) -> Self
pub fn with_max_snapshots(self, max: usize) -> Self
Set a maximum retention limit for snapshots.
Sourcepub fn take_snapshot(
&mut self,
timestamp_secs: u64,
label: impl Into<String>,
tasks: Vec<TaskSnapshot>,
) -> SnapshotSeq
pub fn take_snapshot( &mut self, timestamp_secs: u64, label: impl Into<String>, tasks: Vec<TaskSnapshot>, ) -> SnapshotSeq
Take a new snapshot and add it to the store.
Sourcepub fn latest(&self) -> Option<&WorkflowSnapshot>
pub fn latest(&self) -> Option<&WorkflowSnapshot>
Get the latest snapshot.
Sourcepub fn get(&self, seq: SnapshotSeq) -> Option<&WorkflowSnapshot>
pub fn get(&self, seq: SnapshotSeq) -> Option<&WorkflowSnapshot>
Get a snapshot by sequence number.
Sourcepub fn list(&self) -> Vec<(SnapshotSeq, &str)>
pub fn list(&self) -> Vec<(SnapshotSeq, &str)>
List all snapshot sequence numbers and labels.
Sourcepub fn diff(&self, a: SnapshotSeq, b: SnapshotSeq) -> Option<Vec<String>>
pub fn diff(&self, a: SnapshotSeq, b: SnapshotSeq) -> Option<Vec<String>>
Compare two snapshots and return task ids whose state changed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SnapshotStore
impl RefUnwindSafe for SnapshotStore
impl Send for SnapshotStore
impl Sync for SnapshotStore
impl Unpin for SnapshotStore
impl UnsafeUnpin for SnapshotStore
impl UnwindSafe for SnapshotStore
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