pub struct HostReconnectPolicy { /* private fields */ }Expand description
Reconnect behavior accepted by a host backend.
Implementations§
Source§impl HostReconnectPolicy
impl HostReconnectPolicy
Sourcepub fn bounded(max_attempts: u32, backoff_ms: u32) -> Self
pub fn bounded(max_attempts: u32, backoff_ms: u32) -> Self
Returns a policy that reconnects up to max_attempts times with a fixed
backoff_ms delay between attempts.
§Examples
use sim_lib_stream_host::HostReconnectPolicy;
let policy = HostReconnectPolicy::bounded(3, 250);
assert!(policy.enabled());
assert_eq!(policy.max_attempts(), 3);
assert_eq!(policy.backoff_ms(), 250);Sourcepub fn max_attempts(&self) -> u32
pub fn max_attempts(&self) -> u32
Returns the maximum number of reconnect attempts.
Sourcepub fn backoff_ms(&self) -> u32
pub fn backoff_ms(&self) -> u32
Returns the backoff delay between attempts in milliseconds.
Trait Implementations§
Source§impl Clone for HostReconnectPolicy
impl Clone for HostReconnectPolicy
Source§fn clone(&self) -> HostReconnectPolicy
fn clone(&self) -> HostReconnectPolicy
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 HostReconnectPolicy
impl Debug for HostReconnectPolicy
impl Eq for HostReconnectPolicy
Source§impl PartialEq for HostReconnectPolicy
impl PartialEq for HostReconnectPolicy
Source§fn eq(&self, other: &HostReconnectPolicy) -> bool
fn eq(&self, other: &HostReconnectPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for HostReconnectPolicy
Auto Trait Implementations§
impl Freeze for HostReconnectPolicy
impl RefUnwindSafe for HostReconnectPolicy
impl Send for HostReconnectPolicy
impl Sync for HostReconnectPolicy
impl Unpin for HostReconnectPolicy
impl UnsafeUnpin for HostReconnectPolicy
impl UnwindSafe for HostReconnectPolicy
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