Enum DisconnectReason
enum DisconnectReason {
UserRequested,
ConnectionLost,
ServerDisconnect(ReasonCode),
ConnectRejected(ReasonCode),
InvalidOptions,
PersistenceFailed,
}Available on crate feature
tokio only.Expand description
Why one connection attempt ended.
Variants§
UserRequested
The user called stop() or dropped all client handles.
ConnectionLost
The connection was lost due to an I/O or protocol error.
ServerDisconnect(ReasonCode)
The server sent a DISCONNECT packet with this reason code.
ConnectRejected(ReasonCode)
CONNACK carried an error reason code (the broker refused the connection).
InvalidOptions
Options could not be encoded (e.g. properties exceed max length).
PersistenceFailed
The persistence backend failed to write. The connection is dropped rather than acknowledging state that was never made durable.
Implementations§
§impl DisconnectReason
impl DisconnectReason
fn outbound_failed(err: &Error) -> Self
fn outbound_failed(err: &Error) -> Self
Logs a failure to buffer outbound packets. The connection ends without a DISCONNECT, which could not be buffered either.
Trait Implementations§
§impl Clone for DisconnectReason
impl Clone for DisconnectReason
§fn clone(&self) -> DisconnectReason
fn clone(&self) -> DisconnectReason
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 moreimpl Copy for DisconnectReason
Auto Trait Implementations§
impl Freeze for DisconnectReason
impl RefUnwindSafe for DisconnectReason
impl Send for DisconnectReason
impl Sync for DisconnectReason
impl Unpin for DisconnectReason
impl UnsafeUnpin for DisconnectReason
impl UnwindSafe for DisconnectReason
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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