Expand description
sage_mqtt is a an encoding/decoding library for MQTT 5.0 protocol.
The library consists in pivot types, such as UTF8String that can be
written to and read from a stream as well as converted to standard Rust
types.
Modules§
Structs§
- Auth
- The
Authpacket is used for enhanced authentication upon connection. When a client connects to a server, it can initiates an authentication using theAuthenticationstructure. Then the client and server exchangeAuthpackets until either the the client sends aDisconnectpacket or the server respond with aConnackpacket. - Authentication
- By default,
Connectpackets provide optionaluser_nameandpasswordfields which can be used to provide basic authentication. Enhanced authentication can be provided by using anAuthenticationstructure which will initialize a challenge / response style authentication. Ii might imply the exchange of severalAuthwith reason codeContinueAuthenticationuntil eventually one is send with eitherSuccessor any relevant error code and, in that case, close the connection. The authentication method which is used as an agreement on how authentication exchanges will perform. Authentication data can be sent at any moment according to this agreement. See the section 4.12 (Enhanced Authentication) of the MQTT 5 specifications for examples. - ConnAck
- The
Connackmessage is sent from the server to the client to acknowledge the connection request. This can be the direct response to aConnectmessage or the closing exchange ofConnackpackets. - Connect
- The
Connectcontrol packet is used to open a session. It is the first Packet a client must send to a server once the connection is established. A Connect packet can only be sent once for each connection. - Disconnect
- A
Disconnectpacket can be sent by the client or the server to gracefully disconnect. - PingReq
- A ping request message
- Ping
Resp - A ping response message
- PubAck
- A
PubAckis the response for aPublishmessage withAtLeastOnceas quality of service. - PubComp
- The
PubComppacket is sent during anExactlyOncequality of service publish. - PubRec
- The
PubRecpacket is sent during anExactlyOncequality of service publish. - PubRel
- The
PubRelpacket is sent during anExactlyOncequality of service publish. - Publish
- The
Publishpacket is used to send an application message to a given topic. - SubAck
- The
SubAckpacket is sent by a server to confirm aSubscribehas been received and processed. - Subscribe
- The subscribe packet is a request from the client to listen to one or more topics.
- Subscription
Options - Options used to describe a specific subscription.
- Topic
- A topic name a broker or client publishes to
- UnSub
Ack - An
UnSubAckis sent by the server to acknowledge an unsubscribe request. - UnSubscribe
- An
Unsubscribepacket is sent from the client to unsubsribe to a topic. - Will
- Due to the unstable nature of a connexion, the client can loose its connection to the server. This ungraceful disconnect can be notified to every other clients by specifying a Last Will message that is given upon connection. When a client ungracefully disconnect from a server (when the keep alive is reached), the server will publish the Last Will message to anyone subscribed to its topic.
Enums§
- Error
- The error type for Sage MQTT operations
- Packet
- The standard type to manipulate a AsyncRead/AsyncWrite-able MQTT packet. Each packet is an enum value with its own type.
- QoS
- Description the quality of service used in message publishing.
- Reason
Code - A
ReasonCodeis an identifier describing a response in any ackowledgement packet (such asConnackorSubAck) - Retain
Handling - This option specifies whether retained messages are sent when the subscription is established;