pub struct LoopModeState {
pub iterations_run: u64,
pub iterations_succeeded: u64,
pub iterations_failed: u64,
pub consecutive_failures: u32,
pub started_at_epoch_secs: u64,
pub last_tick_epoch_secs: u64,
}Expand description
Runtime state of a long-running iteration-mode agent.
Fields§
§iterations_run: u64§iterations_succeeded: u64§iterations_failed: u64§consecutive_failures: u32§started_at_epoch_secs: u64§last_tick_epoch_secs: u64Implementations§
Source§impl LoopModeState
impl LoopModeState
Sourcepub fn record_success(&mut self, now_epoch_secs: u64)
pub fn record_success(&mut self, now_epoch_secs: u64)
Record a successful iteration. Resets the consecutive-failure counter.
Sourcepub fn record_failure(&mut self, now_epoch_secs: u64)
pub fn record_failure(&mut self, now_epoch_secs: u64)
Record a failed iteration. Increments the consecutive-failure counter.
Sourcepub fn should_halt(&self, config: &LoopModeConfig) -> Option<LoopFinishReason>
pub fn should_halt(&self, config: &LoopModeConfig) -> Option<LoopFinishReason>
Check whether the state should halt given the provided config.
Trait Implementations§
Source§impl Clone for LoopModeState
impl Clone for LoopModeState
Source§fn clone(&self) -> LoopModeState
fn clone(&self) -> LoopModeState
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 LoopModeState
impl Debug for LoopModeState
Source§impl Default for LoopModeState
impl Default for LoopModeState
Source§fn default() -> LoopModeState
fn default() -> LoopModeState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for LoopModeState
impl<'de> Deserialize<'de> for LoopModeState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for LoopModeState
Source§impl PartialEq for LoopModeState
impl PartialEq for LoopModeState
Source§impl Serialize for LoopModeState
impl Serialize for LoopModeState
impl StructuralPartialEq for LoopModeState
Auto Trait Implementations§
impl Freeze for LoopModeState
impl RefUnwindSafe for LoopModeState
impl Send for LoopModeState
impl Sync for LoopModeState
impl Unpin for LoopModeState
impl UnsafeUnpin for LoopModeState
impl UnwindSafe for LoopModeState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.