Enum DisconnectCause
#[non_exhaustive]pub enum DisconnectCause {
ConnectFailed,
ConnectionLost,
ServerDisconnect(ReasonCode),
PersistenceFailed,
}Expand description
Why a connection went down, carried by
Reconnecting. Deliberately coarse;
the full error detail is available through tracing.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
ConnectFailed
The transport failed (DNS, TCP, TLS) or the handshake timed out.
ConnectionLost
An established connection was lost: an I/O error or EOF, a keep-alive or ack timeout, or a protocol error reported with a DISCONNECT.
ServerDisconnect(ReasonCode)
The broker closed the session with a DISCONNECT packet.
PersistenceFailed
The persistence backend failed to write; the unpersisted ops are retained and retried after reconnecting.
Trait Implementations§
§impl Clone for DisconnectCause
impl Clone for DisconnectCause
§fn clone(&self) -> DisconnectCause
fn clone(&self) -> DisconnectCause
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 more§impl Debug for DisconnectCause
impl Debug for DisconnectCause
§impl PartialEq for DisconnectCause
impl PartialEq for DisconnectCause
impl Copy for DisconnectCause
impl Eq for DisconnectCause
impl StructuralPartialEq for DisconnectCause
Auto Trait Implementations§
impl Freeze for DisconnectCause
impl RefUnwindSafe for DisconnectCause
impl Send for DisconnectCause
impl Sync for DisconnectCause
impl Unpin for DisconnectCause
impl UnwindSafe for DisconnectCause
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more