pub struct StateValidator;Expand description
Validates state transitions and repairs recovered state.
Implementations§
Source§impl StateValidator
impl StateValidator
Sourcepub fn validate_transition(&self, from: TaskState, to: TaskState) -> Result<()>
pub fn validate_transition(&self, from: TaskState, to: TaskState) -> Result<()>
Validate a single proposed transition, returning an error if illegal.
Sourcepub fn repair(
&self,
records: &mut HashMap<String, TaskRecord>,
max_attempts: u32,
) -> RepairReport
pub fn repair( &self, records: &mut HashMap<String, TaskRecord>, max_attempts: u32, ) -> RepairReport
Repair a set of recovered records in place.
A task that was Running or Retrying when the process died is reset:
if it still has retry budget (attempts < max_attempts) it becomes
Pending (so dependency checks re-run), otherwise it is marked Failed.
Trait Implementations§
Source§impl Clone for StateValidator
impl Clone for StateValidator
Source§fn clone(&self) -> StateValidator
fn clone(&self) -> StateValidator
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 StateValidator
impl Debug for StateValidator
Source§impl Default for StateValidator
impl Default for StateValidator
Source§fn default() -> StateValidator
fn default() -> StateValidator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StateValidator
impl RefUnwindSafe for StateValidator
impl Send for StateValidator
impl Sync for StateValidator
impl Unpin for StateValidator
impl UnsafeUnpin for StateValidator
impl UnwindSafe for StateValidator
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