Struct sage_mqtt::ConnAck[][src]

pub struct ConnAck {
Show 18 fields pub session_present: bool, pub reason_code: ReasonCode, pub session_expiry_interval: Option<u32>, pub receive_maximum: u16, pub maximum_qos: QoS, pub retain_available: bool, pub maximum_packet_size: Option<u32>, pub assigned_client_id: Option<ClientID>, pub topic_alias_maximum: u16, pub reason_string: Option<String>, pub user_properties: Vec<(String, String)>, pub wildcard_subscription_available: bool, pub subscription_identifiers_available: bool, pub shared_subscription_available: bool, pub keep_alive: Option<u16>, pub response_information: Option<String>, pub reference: Option<String>, pub authentication: Option<Authentication>,
}
Expand description

The Connack message is sent from the server to the client to acknowledge the connection request. This can be the direct response to a Connect message or the closing exchange of Connack packets.

Fields

session_present: bool

If the session_present is true, the connection is accepted using a previously and unexpired session.

reason_code: ReasonCode

The reason code for the connect acknowledgement.

  • Success
  • UnspecifiedError
  • MalformedPacket
  • ProtocolError
  • ImplementationSpecificError
  • UnsupportedProtocolVersion
  • ClientIdentifierNotValid
  • BadUserNameOrPassword
  • NotAuthorized
  • ServerUnavailable
  • ServerBusy
session_expiry_interval: Option<u32>

The session expiry interval the server will use. If absent the server simply accepted the value sent by the server in the Connect packet.

receive_maximum: u16

The maximum number of AtLeastOnce and ExactlyOnce qualities of service the server will concurrently treat for the client.

maximum_qos: QoS

The maximum quality of service the server is willing to accept. This value cannot be ExactlyOnce. Any server receiving a message with QoS higher than it’s maximum is expected to close the connection.

retain_available: bool

true if the server supports retaining messages. false otherwise. Sending retain messages (including Last Will) to a server which does not support this feature will resulting in a disconnection.

maximum_packet_size: Option<u32>

The maximum size in bytes the server is willing to accept. This value cannot be 0. If absent there is not maximum packet size.

assigned_client_id: Option<ClientID>

If the Connect packet did not have any client id, the server will send one using assigned_client_id.

topic_alias_maximum: u16

The maximum value the server will accept as topic alias. If 0 the server does not accept topic aliases.

reason_string: Option<String>

A human readable reason string used to describe the connack. This field is optional.

user_properties: Vec<(String, String)>

General purpose user properties.

wildcard_subscription_available: bool

If true, the server accepts subscribing to topics using wildcards.

subscription_identifiers_available: bool

If true, the server accepts subscription identifiers.

shared_subscription_available: bool

If true, the server accepts shared subscriptions.

keep_alive: Option<u16>

The server can override the keep alive value requested by the client upon Connect.

response_information: Option<String>

If the client asked for response information, the server may send it in response_information. The response information can be used by the client as an hint to generate reponse topic when making Request/Reponse messages.

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.

authentication: Option<Authentication>

Upon using enhanced connexion, ending the Connack exchange will result in a ConnAck packet which may contain Authentication data.

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.