pub struct ReconnectConfig {
pub interval: Duration,
pub condition: ReconnectCondition,
pub retry_send: bool,
}
Expand description
Reconnection configuration.
Fields§
§interval: Duration
Sets an interval duration of automatic reconnection.
condition: ReconnectCondition
Specifies the condition for reconnecting.
retry_send: bool
Specifies whether to re-send messages that may have failed to be sent when reconnecting.
Implementations§
Source§impl ReconnectConfig
impl ReconnectConfig
Sourcepub fn none() -> ReconnectConfig
pub fn none() -> ReconnectConfig
Creates a ReconnectConfig
that disables reconnection.
Sourcepub fn with_condition(condition: ReconnectCondition) -> ReconnectConfig
pub fn with_condition(condition: ReconnectCondition) -> ReconnectConfig
Creates a ReconnectConfig
with the given condition.
Sourcepub fn with_interval(interval: Duration) -> ReconnectConfig
pub fn with_interval(interval: Duration) -> ReconnectConfig
Creates a ReconnectConfig
with the given interval.
Trait Implementations§
Source§impl Clone for ReconnectConfig
impl Clone for ReconnectConfig
Source§fn clone(&self) -> ReconnectConfig
fn clone(&self) -> ReconnectConfig
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 ReconnectConfig
impl Debug for ReconnectConfig
Source§impl Default for ReconnectConfig
impl Default for ReconnectConfig
Source§fn default() -> ReconnectConfig
fn default() -> ReconnectConfig
interval
is 5 secs and retry_send
is true
by default.
Auto Trait Implementations§
impl Freeze for ReconnectConfig
impl !RefUnwindSafe for ReconnectConfig
impl Send for ReconnectConfig
impl Sync for ReconnectConfig
impl Unpin for ReconnectConfig
impl !UnwindSafe for ReconnectConfig
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