pub struct CheckpointManager { /* private fields */ }Expand description
Manages a series of checkpoints for one workflow.
Implementations§
Source§impl CheckpointManager
impl CheckpointManager
Sourcepub fn new(policy: CheckpointPolicy) -> Self
pub fn new(policy: CheckpointPolicy) -> Self
Creates a new manager with the given policy.
Sourcepub fn with_interval(interval_secs: u64) -> Self
pub fn with_interval(interval_secs: u64) -> Self
Creates a manager with a fixed interval policy.
Sourcepub fn set_max_retained(&mut self, max: usize)
pub fn set_max_retained(&mut self, max: usize)
Sets the maximum number of checkpoints to retain.
Sourcepub fn policy(&self) -> CheckpointPolicy
pub fn policy(&self) -> CheckpointPolicy
Returns the current policy.
Sourcepub fn create_checkpoint(&mut self, workflow_id: &str) -> &Checkpoint
pub fn create_checkpoint(&mut self, workflow_id: &str) -> &Checkpoint
Creates and stores a new checkpoint for the given workflow.
Sourcepub fn latest(&self) -> Option<&Checkpoint>
pub fn latest(&self) -> Option<&Checkpoint>
Returns the latest checkpoint, if any.
Sourcepub fn checkpoints_for(&self, workflow_id: &str) -> Vec<&Checkpoint>
pub fn checkpoints_for(&self, workflow_id: &str) -> Vec<&Checkpoint>
Returns all checkpoints for a given workflow ID.
Sourcepub fn interval_secs(&self) -> u64
pub fn interval_secs(&self) -> u64
Returns the configured interval in seconds.
Trait Implementations§
Source§impl Clone for CheckpointManager
impl Clone for CheckpointManager
Source§fn clone(&self) -> CheckpointManager
fn clone(&self) -> CheckpointManager
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CheckpointManager
impl Debug for CheckpointManager
Auto Trait Implementations§
impl Freeze for CheckpointManager
impl RefUnwindSafe for CheckpointManager
impl Send for CheckpointManager
impl Sync for CheckpointManager
impl Unpin for CheckpointManager
impl UnsafeUnpin for CheckpointManager
impl UnwindSafe for CheckpointManager
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