use std::time::Duration;
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct RecoveryConfig {
pub max_consecutive_drops: u32,
pub quarantine_duration: Duration,
pub log_dropped_frames: bool,
}
impl Default for RecoveryConfig {
fn default() -> Self {
Self {
max_consecutive_drops: 10,
quarantine_duration: Duration::from_secs(30),
log_dropped_frames: true,
}
}
}
impl RecoveryConfig {
#[must_use]
pub fn max_consecutive_drops(mut self, count: u32) -> Self {
self.max_consecutive_drops = count;
self
}
#[must_use]
pub fn quarantine_duration(mut self, duration: Duration) -> Self {
self.quarantine_duration = duration;
self
}
#[must_use]
pub fn log_dropped_frames(mut self, enabled: bool) -> Self {
self.log_dropped_frames = enabled;
self
}
}