Struct sage_mqtt::Disconnect[][src]

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.