pub struct CheckpointConfig<S: WorkflowState> {
pub trigger: TriggerPolicy,
pub retention: RetentionPolicy,
/* private fields */
}Expand description
Checkpoint 保存配置 — 传入 run_execution_loop 即可启用自动保存。
Fields§
§trigger: TriggerPolicy触发策略
retention: RetentionPolicy保留策略
Implementations§
Source§impl<S: WorkflowState> CheckpointConfig<S>
impl<S: WorkflowState> CheckpointConfig<S>
pub fn new( save_fn: impl Fn(Checkpoint<S>, TraceId) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send>> + Send + Sync + 'static, graph_hash: u64, ) -> Self
pub fn with_trigger(self, trigger: TriggerPolicy) -> Self
pub fn with_retention(self, retention: RetentionPolicy) -> Self
pub fn with_store(self, store: Arc<dyn BlobCheckpointStore>) -> Self
pub fn with_policy(self, policy: CheckpointPolicy) -> Self
pub async fn apply_retention( &self, trace_id: &TraceId, ) -> Result<(), CheckpointStoreError>
Auto Trait Implementations§
impl<S> !RefUnwindSafe for CheckpointConfig<S>
impl<S> !UnwindSafe for CheckpointConfig<S>
impl<S> Freeze for CheckpointConfig<S>
impl<S> Send for CheckpointConfig<S>
impl<S> Sync for CheckpointConfig<S>
impl<S> Unpin for CheckpointConfig<S>
impl<S> UnsafeUnpin for CheckpointConfig<S>
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