[][src]Crate sage_mqtt

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

codec

encode/decode MQTT fundamental types

Structs

Auth

The Auth packet is used for enhanced authentication upon connection. When a client connects to a server, it can initiates an authentication using the Authentication structure. Then the client and server exchange Auth packets until either the the client sends a Disconnect packet or the server respond with a Connack packet.

Authentication

By default, Connect packets provide optional user_name and password fields which can be used to provide basic authentication. Enhanced authentication can be provided by using an Authentication structure which will initialize a challenge / response style authentication. Ii might imply the exchange of several Auth with reason code ContinueAuthentication until eventually one is send with either Success or 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 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.

Connect

The Connect control 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 Disconnect packet can be sent by the client or the server to gracefully disconnect.

PubAck

A PubAck is the response for a Publish message with AtLeastOnce as quality of service.

PubComp

The PubComp packet is sent during an ExactlyOnce quality of service publish.

PubRec

The PubRec packet is sent during an ExactlyOnce quality of service publish.

PubRel

The PubRel packet is sent during an ExactlyOnce quality of service publish.

Publish

The Publish packet is used to send an application message to a given topic.

SubAck

The SubAck packet is sent by a server to confirm a Subscribe has been received and processed.

Subscribe

The subscribe packet is a request from the client to listen to one or more topics.

SubscriptionOptions

Options used to describe a specific subscription.

UnSubAck

An UnSubAck is sent by the server to acknowledge an unsubscribe request.

UnSubscribe

An Unsubscribe packet 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

ControlPacket

The standard type to manipulate a AsyncRead/AsyncWrite-able MQTT packet. Each packet is an enum value with its own type.

Error

The error type for Sage MQTT operations

QoS

Description the quality of service used in message publishing.

ReasonCode

A ReasonCode is an identifier describing a response in any ackowledgement packet (such as Connack or SubAck)

RetainHandling

This option specifies whether retained messages are sent when the subscription is established;

Type Definitions

ClientID

String alias to represent a client identifier

Result

Standard Result type for Sage MQTT