pub struct SessionRetryPolicy { /* private fields */ }Expand description
Session retry policy.
Configure the maximum delay between reconnect attempts, the initial delay between reconnect attempts, and the maximum number of reconnect attempts.
Implementations§
Source§impl SessionRetryPolicy
impl SessionRetryPolicy
Sourcepub const DEFAULT_RETRY_LIMIT: u32 = 10
pub const DEFAULT_RETRY_LIMIT: u32 = 10
Default maximum number of retries.
Sourcepub const DEFAULT_INITIAL_SLEEP_MS: u64 = 500
pub const DEFAULT_INITIAL_SLEEP_MS: u64 = 500
Default initial delay between requests in milliseconds.
Sourcepub const DEFAULT_MAX_SLEEP_MS: u64 = 30000
pub const DEFAULT_MAX_SLEEP_MS: u64 = 30000
Default maximum delay between requests in milliseconds.
Sourcepub fn new(
max_sleep: Duration,
retry_limit: Option<u32>,
initial_sleep: Duration,
) -> SessionRetryPolicy
pub fn new( max_sleep: Duration, retry_limit: Option<u32>, initial_sleep: Duration, ) -> SessionRetryPolicy
Create a new session retry policy.
Sourcepub fn infinity(
max_sleep: Duration,
initial_sleep: Duration,
) -> SessionRetryPolicy
pub fn infinity( max_sleep: Duration, initial_sleep: Duration, ) -> SessionRetryPolicy
Retry forever with the given max delay and initial delay.
Sourcepub fn never() -> SessionRetryPolicy
pub fn never() -> SessionRetryPolicy
Never reconnect.
Trait Implementations§
Source§impl Clone for SessionRetryPolicy
impl Clone for SessionRetryPolicy
Source§fn clone(&self) -> SessionRetryPolicy
fn clone(&self) -> SessionRetryPolicy
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 SessionRetryPolicy
impl Debug for SessionRetryPolicy
Source§impl Default for SessionRetryPolicy
impl Default for SessionRetryPolicy
Source§fn default() -> SessionRetryPolicy
fn default() -> SessionRetryPolicy
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SessionRetryPolicy
impl RefUnwindSafe for SessionRetryPolicy
impl Send for SessionRetryPolicy
impl Sync for SessionRetryPolicy
impl Unpin for SessionRetryPolicy
impl UnsafeUnpin for SessionRetryPolicy
impl UnwindSafe for SessionRetryPolicy
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