pub struct TimeLoop {
pub id: TemporalId,
pub pattern: LoopPattern,
pub iterations: Vec<LoopIteration>,
pub total_time_spent_secs: i64,
pub active: bool,
pub root_cause: Option<RootCauseAnalysis>,
pub breaker: Option<LoopBreaker>,
pub detected_at: DateTime<Utc>,
}Expand description
A detected repetitive pattern that wastes time.
Fields§
§id: TemporalIdLoop identifier.
pattern: LoopPatternPattern signature.
iterations: Vec<LoopIteration>Detected iterations.
total_time_spent_secs: i64Total time spent in this loop (seconds).
active: boolIs the loop currently active?
root_cause: Option<RootCauseAnalysis>Root cause analysis.
breaker: Option<LoopBreaker>Suggested loop breaker.
detected_at: DateTime<Utc>When this loop was first detected.
Implementations§
Source§impl TimeLoop
impl TimeLoop
Sourcepub fn new(pattern: LoopPattern) -> Self
pub fn new(pattern: LoopPattern) -> Self
Create a new time loop detection.
Sourcepub fn add_iteration(&mut self, iteration: LoopIteration)
pub fn add_iteration(&mut self, iteration: LoopIteration)
Add an iteration to this loop.
Sourcepub fn iteration_count(&self) -> u32
pub fn iteration_count(&self) -> u32
Get the number of iterations.
Sourcepub fn mark_broken(&mut self)
pub fn mark_broken(&mut self)
Mark loop as broken.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TimeLoop
impl<'de> Deserialize<'de> for TimeLoop
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
Auto Trait Implementations§
impl Freeze for TimeLoop
impl RefUnwindSafe for TimeLoop
impl Send for TimeLoop
impl Sync for TimeLoop
impl Unpin for TimeLoop
impl UnsafeUnpin for TimeLoop
impl UnwindSafe for TimeLoop
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