Enum ConnectionStatus
#[non_exhaustive]pub enum ConnectionStatus {
Disconnected,
Connected,
Reconnecting {
cause: DisconnectCause,
},
Rejected(ReasonCode),
}Expand description
The connection status of an MqttClient.
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.
Disconnected
Not connected to any broker.
This is the initial state and the final state after a
stop call or when
reconnection is disabled and all attempts have been exhausted.
Connected
A CONNACK was received and the client is actively exchanging packets.
Reconnecting
The connection went down and the client is waiting before the next reconnection attempt.
Fields
§
cause: DisconnectCauseWhy the connection went down.
Rejected(ReasonCode)
The broker refused the connection with the given CONNACK reason code.
This is the final status when reconnection is disabled (or a fatal
rejection stopped it, see
ReconnectOptions::stop_on_fatal_rejection), or the status held
while backing off before another attempt.
Trait Implementations§
§impl Clone for ConnectionStatus
impl Clone for ConnectionStatus
§fn clone(&self) -> ConnectionStatus
fn clone(&self) -> ConnectionStatus
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 ConnectionStatus
impl Debug for ConnectionStatus
§impl Default for ConnectionStatus
impl Default for ConnectionStatus
§fn default() -> ConnectionStatus
fn default() -> ConnectionStatus
Returns the “default value” for a type. Read more
§impl PartialEq for ConnectionStatus
impl PartialEq for ConnectionStatus
impl Copy for ConnectionStatus
impl Eq for ConnectionStatus
impl StructuralPartialEq for ConnectionStatus
Auto Trait Implementations§
impl Freeze for ConnectionStatus
impl RefUnwindSafe for ConnectionStatus
impl Send for ConnectionStatus
impl Sync for ConnectionStatus
impl Unpin for ConnectionStatus
impl UnwindSafe for ConnectionStatus
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