pub enum Durability {
Sync,
Async,
Exit,
Every {
n: u64,
mode: Box<Durability>,
},
Custom(Arc<dyn DurabilityHook>),
}Expand description
Checkpoint timing relative to step execution.
Variants§
Sync
Await cp.save inline after each step (default).
Async
Spawn cp.save without awaiting. Crash before the spawn lands
loses the most recent step.
Exit
Save only at graph completion. No intermediate checkpoints.
Every
Save every Nth step (n>=1) using the wrapped sub-mode for that step. Other steps are skipped. The graph-completion save is always emitted regardless of stride.
Fields
mode: Box<Durability>Mode used on the Nth step.
Custom(Arc<dyn DurabilityHook>)
Fully user-defined policy.
Implementations§
Source§impl Durability
impl Durability
Sourcepub fn decide(&self, step: u64, is_terminal: bool) -> DurabilityDecision
pub fn decide(&self, step: u64, is_terminal: bool) -> DurabilityDecision
Decide what action to take at the end of step. is_terminal
is true on the graph-completion save (always honored except for
Skip-returning custom hooks that opt out).
Sourcepub fn save_per_step_sync(&self) -> bool
pub fn save_per_step_sync(&self) -> bool
True if the engine should save inline after each step.
Sourcepub fn save_per_step_async(&self) -> bool
pub fn save_per_step_async(&self) -> bool
True if the engine should spawn an async save after each step.
Sourcepub fn save_on_exit(&self) -> bool
pub fn save_on_exit(&self) -> bool
True if a final-only save should be emitted on graph completion.
Trait Implementations§
Source§impl Clone for Durability
impl Clone for Durability
Source§fn clone(&self) -> Durability
fn clone(&self) -> Durability
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more