pub struct ReconnectPolicy {
pub initial_delay: Duration,
pub max_delay: Duration,
/* private fields */
}Expand description
Exponential backoff policy for reflector reconnection.
Provides a state machine that tracks reconnection attempts and computes the next delay using exponential backoff with a configurable ceiling.
§Usage
use kenwood_thd75::mmdvm::ReconnectPolicy;
let mut policy = ReconnectPolicy::default();
// After first failure:
let delay = policy.next_delay();
// ... wait `delay`, then retry ...
// On success:
policy.reset();Fields§
§initial_delay: DurationInitial delay before the first retry.
max_delay: DurationMaximum delay between retries.
Implementations§
Source§impl ReconnectPolicy
impl ReconnectPolicy
Trait Implementations§
Source§impl Clone for ReconnectPolicy
impl Clone for ReconnectPolicy
Source§fn clone(&self) -> ReconnectPolicy
fn clone(&self) -> ReconnectPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReconnectPolicy
impl Debug for ReconnectPolicy
Auto Trait Implementations§
impl Freeze for ReconnectPolicy
impl RefUnwindSafe for ReconnectPolicy
impl Send for ReconnectPolicy
impl Sync for ReconnectPolicy
impl Unpin for ReconnectPolicy
impl UnwindSafe for ReconnectPolicy
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