pub struct LoopState {
pub iteration: usize,
pub start_time: Instant,
pub breaker: CircuitBreaker,
pub options: LoopOptions,
pub total_score: f64,
pub keep_count: usize,
pub discard_count: usize,
}Expand description
Loop state — tracks progress across iterations.
Fields§
§iteration: usize§start_time: Instant§breaker: CircuitBreaker§options: LoopOptions§total_score: f64§keep_count: usize§discard_count: usizeImplementations§
Source§impl LoopState
impl LoopState
pub fn new(options: LoopOptions) -> Self
Sourcepub fn should_stop(&self) -> Option<String>
pub fn should_stop(&self) -> Option<String>
Check if loop should continue. Returns None to continue, Some(reason) to stop.
Sourcepub fn record_iteration(&mut self, stats: &RunStats) -> bool
pub fn record_iteration(&mut self, stats: &RunStats) -> bool
Record iteration result and check circuit breaker.
Sourcepub fn elapsed_display(&self) -> String
pub fn elapsed_display(&self) -> String
Elapsed time as human-readable string.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LoopState
impl RefUnwindSafe for LoopState
impl Send for LoopState
impl Sync for LoopState
impl Unpin for LoopState
impl UnsafeUnpin for LoopState
impl UnwindSafe for LoopState
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