pub struct WaveTracker { /* private fields */ }Expand description
Central state machine for tracking active waves.
Implementations§
Source§impl WaveTracker
impl WaveTracker
Sourcepub fn register_wave(&mut self, wave_id: String, expected_total: u32)
pub fn register_wave(&mut self, wave_id: String, expected_total: u32)
Register a new wave.
Warns and overwrites if a wave with the same ID is already active.
Sourcepub fn record_result(
&mut self,
wave_id: &str,
index: u32,
events: Vec<Event>,
) -> WaveProgress
pub fn record_result( &mut self, wave_id: &str, index: u32, events: Vec<Event>, ) -> WaveProgress
Record result events for a wave instance. Returns the wave progress after recording.
Sourcepub fn record_failure(
&mut self,
wave_id: &str,
index: u32,
error: String,
duration: Duration,
) -> WaveProgress
pub fn record_failure( &mut self, wave_id: &str, index: u32, error: String, duration: Duration, ) -> WaveProgress
Record a failure for a wave instance. Returns the wave progress after recording.
Sourcepub fn is_complete(&self, wave_id: &str) -> bool
pub fn is_complete(&self, wave_id: &str) -> bool
Check if a wave is complete (all results + failures == expected total).
Sourcepub fn take_wave_results(&mut self, wave_id: &str) -> Option<CompletedWave>
pub fn take_wave_results(&mut self, wave_id: &str) -> Option<CompletedWave>
Consume a completed wave, removing it from tracking.
Sourcepub fn has_active_waves(&self) -> bool
pub fn has_active_waves(&self) -> bool
Check if any wave is currently active.
Sourcepub fn timed_out_waves(&self, timeout: Duration) -> Vec<&str>
pub fn timed_out_waves(&self, timeout: Duration) -> Vec<&str>
Returns wave IDs that have exceeded the given timeout since registration.
Useful for enforcing aggregate timeouts — callers can force-complete these waves with partial results.
Trait Implementations§
Source§impl Debug for WaveTracker
impl Debug for WaveTracker
Source§impl Default for WaveTracker
impl Default for WaveTracker
Source§fn default() -> WaveTracker
fn default() -> WaveTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WaveTracker
impl RefUnwindSafe for WaveTracker
impl Send for WaveTracker
impl Sync for WaveTracker
impl Unpin for WaveTracker
impl UnsafeUnpin for WaveTracker
impl UnwindSafe for WaveTracker
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