pub struct EventReconnectPolicy {
pub initial_delay: Duration,
pub max_delay: Duration,
pub stable_reset_after: Duration,
pub jitter_min_percent: u16,
pub jitter_max_percent: u16,
}Expand description
Reconnect policy for a transient event subscription.
Fields§
§initial_delay: DurationInitial reconnect delay.
max_delay: DurationMaximum reconnect delay.
stable_reset_after: DurationStable connection duration after which the attempt counter resets.
jitter_min_percent: u16Minimum jitter percentage applied to the selected delay.
jitter_max_percent: u16Maximum jitter percentage applied to the selected delay.
Implementations§
Source§impl EventReconnectPolicy
impl EventReconnectPolicy
Sourcepub fn reconnect_delay(self, reconnect_attempt: u32) -> Duration
pub fn reconnect_delay(self, reconnect_attempt: u32) -> Duration
Calculates the bounded jittered delay for a one-based reconnect attempt.
Trait Implementations§
Source§impl Clone for EventReconnectPolicy
impl Clone for EventReconnectPolicy
Source§fn clone(&self) -> EventReconnectPolicy
fn clone(&self) -> EventReconnectPolicy
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 moreSource§impl Debug for EventReconnectPolicy
impl Debug for EventReconnectPolicy
Source§impl Default for EventReconnectPolicy
impl Default for EventReconnectPolicy
Source§impl PartialEq for EventReconnectPolicy
impl PartialEq for EventReconnectPolicy
Source§fn eq(&self, other: &EventReconnectPolicy) -> bool
fn eq(&self, other: &EventReconnectPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for EventReconnectPolicy
impl Eq for EventReconnectPolicy
impl StructuralPartialEq for EventReconnectPolicy
Auto Trait Implementations§
impl Freeze for EventReconnectPolicy
impl RefUnwindSafe for EventReconnectPolicy
impl Send for EventReconnectPolicy
impl Sync for EventReconnectPolicy
impl Unpin for EventReconnectPolicy
impl UnsafeUnpin for EventReconnectPolicy
impl UnwindSafe for EventReconnectPolicy
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