pub struct WatchConfig {
pub interval: Duration,
pub max_backoff: Duration,
}Expand description
Configuration for watch_external_with_config.
Controls the base polling interval and the ceiling applied during exponential backoff when consecutive poll failures occur.
§Examples
use std::time::Duration;
use koprs_external::watcher::WatchConfig;
// Poll every 30 s; back off up to 10 min on errors.
let config = WatchConfig::new(Duration::from_secs(30))
.with_max_backoff(Duration::from_secs(600));Fields§
§interval: DurationBase polling interval used after a successful poll.
max_backoff: DurationMaximum wait during backoff (default: interval × 32).
Implementations§
Source§impl WatchConfig
impl WatchConfig
Sourcepub fn new(interval: Duration) -> Self
pub fn new(interval: Duration) -> Self
Create a new configuration with the given base interval.
max_backoff defaults to interval × 32 (five doublings from the
base). Override with with_max_backoff.
Sourcepub fn with_max_backoff(self, max_backoff: Duration) -> Self
pub fn with_max_backoff(self, max_backoff: Duration) -> Self
Set an explicit upper bound for backoff waits.
Trait Implementations§
Source§impl Clone for WatchConfig
impl Clone for WatchConfig
Source§fn clone(&self) -> WatchConfig
fn clone(&self) -> WatchConfig
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 moreAuto Trait Implementations§
impl Freeze for WatchConfig
impl RefUnwindSafe for WatchConfig
impl Send for WatchConfig
impl Sync for WatchConfig
impl Unpin for WatchConfig
impl UnsafeUnpin for WatchConfig
impl UnwindSafe for WatchConfig
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