#[non_exhaustive]pub struct SseReconnectPolicy {
pub initial_delay: Duration,
pub max_delay: Duration,
pub max_retries: Option<u32>,
}Expand description
Backoff policy for JmapClient::subscribe_events_reconnecting.
Start from Default and adjust the public fields:
let mut policy = SseReconnectPolicy::default();
policy.max_delay = Duration::from_secs(300);
policy.max_retries = Some(10);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.initial_delay: DurationDelay before the first retry; doubled after each further consecutive failure. Default: 1 s.
max_delay: DurationUpper bound on the delay before jitter is applied. Default: 60 s.
max_retries: Option<u32>Consecutive failed attempts to retry before giving up; None retries
forever. A frame arriving resets the count. Default: None.
Trait Implementations§
Source§impl Clone for SseReconnectPolicy
impl Clone for SseReconnectPolicy
impl Copy for SseReconnectPolicy
Source§impl Debug for SseReconnectPolicy
impl Debug for SseReconnectPolicy
Source§impl Default for SseReconnectPolicy
impl Default for SseReconnectPolicy
impl Eq for SseReconnectPolicy
Source§impl PartialEq for SseReconnectPolicy
impl PartialEq for SseReconnectPolicy
impl StructuralPartialEq for SseReconnectPolicy
Auto Trait Implementations§
impl Freeze for SseReconnectPolicy
impl RefUnwindSafe for SseReconnectPolicy
impl Send for SseReconnectPolicy
impl Sync for SseReconnectPolicy
impl Unpin for SseReconnectPolicy
impl UnsafeUnpin for SseReconnectPolicy
impl UnwindSafe for SseReconnectPolicy
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