pub struct Disconnect {
pub reason_code: ReasonCode,
pub session_expiry_interval: Option<u32>,
pub reason_string: Option<String>,
pub user_properties: Vec<(String, String)>,
pub reference: Option<String>,
}
Expand description
A Disconnect
packet can be sent by the client or the server to gracefully
disconnect.
Fields§
§reason_code: ReasonCode
The reason code code the Disconnect
notice.can be any of:
- Client or Server
AdministrativeAction
ImplementationSpecificError
MalformedPacket
MessageRateTooHigh
NormalDisconnection
PacketTooLarge
PayloadFormatInvalid
ProtocolError
QuotaExceeded
ReceiveMaximumExceeded
TopicAliasInvalid
TopicNameInvalid
UnspecifiedError
- Server Only
ConnectionRateExceeded
KeepAliveTimeout
MaximumConnectTime
NotAuthorized
QoSNotSupported
RetainNotSupported
ServerBusy
ServerMoved
ServerShuttingDown
SessionTakenOver
SharedSubscriptionsNotSupported
SubscriptionIdentifiersNotSupported
TopicFilterInvalid
UseAnotherServer
WildcardSubscriptionsNotSupported
- Client Only
DisconnectWithWillMessage
session_expiry_interval: Option<u32>
session_expiry_interval
can be used to override the session expiry
period formerly set upon connection. If not present, the session expiry
interval value set using Connect
or Connack
is still in use.
reason_string: Option<String>
An optional descriptin of the reason for deconnecting.
user_properties: Vec<(String, String)>
General purpose user properties.
reference: Option<String>
If the reason code is ServerMoved
or UserAnotherServer
, the
reference
field is used to inform the client about why new server to
connect to instead.
Trait Implementations§
Source§impl Clone for Disconnect
impl Clone for Disconnect
Source§fn clone(&self) -> Disconnect
fn clone(&self) -> Disconnect
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 Disconnect
impl Debug for Disconnect
Source§impl Default for Disconnect
impl Default for Disconnect
Source§impl From<Disconnect> for Packet
impl From<Disconnect> for Packet
Source§fn from(control: Disconnect) -> Self
fn from(control: Disconnect) -> Self
Converts to this type from the input type.
Source§impl PartialEq for Disconnect
impl PartialEq for Disconnect
impl StructuralPartialEq for Disconnect
Auto Trait Implementations§
impl Freeze for Disconnect
impl RefUnwindSafe for Disconnect
impl Send for Disconnect
impl Sync for Disconnect
impl Unpin for Disconnect
impl UnwindSafe for Disconnect
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