Struct paho_mqtt::async_client::AsyncClient [] [src]

pub struct AsyncClient { /* fields omitted */ }

An asynchronous MQTT connection client.

Methods

impl AsyncClient
[src]

Creates a new MQTT client which can connect to an MQTT broker.

Arguments

  • server_uri The address of the MQTT broker.
  • client_id The unique name of the client. if this is empty, the the broker will assign a unique name.

Connects to an MQTT broker using the specified connect options.

Arguments

  • opts The connect options

Connects to an MQTT broker using the specified connect options.

Arguments

  • opts The connect options

Attempts to reconnect to the broker. This can only be called after a connection was initially made or attempted. It will retry with the same connect options.

Attempts to reconnect to the broker, using callbacks to signal completion. This can only be called after a connection was initially made or attempted. It will retry with the same connect options.

Arguments

  • success_cb The callback for a successful connection.
  • failure_cb The callback for a failed connection attempt.

Disconnects from the MQTT broker.

Arguments

opt_opts Optional disconnect options. Specifying None will use default of immediate (zero timeout) disconnect.

Disconnect from the MQTT broker with a timeout. This will delay the disconnect for up to the specified timeout to allow in-flight messages to complete. This is the same as calling disconnect with options specifying a timeout.

Arguments

timeout The amount of time to wait for the disconnect. This has a resolution in milliseconds.

Determines if this client is currently connected to an MQTT broker.

Sets the callback for when the connection is lost with the broker.

Arguments

  • cb The callback to register with the library. This can be a function or a closure.

Sets the callback for when a message arrives from the broker.

Arguments

  • cb The callback to register with the library. This can be a function or a closure.

Publishes a message to an MQTT broker

Arguments

  • msg The message to publish.

Subscribes to a single topic.

Arguments

topic The topic name qos The quality of service requested for messages

Subscribes to multiple topics simultaneously.

Arguments

topic The topic name qos The quality of service requested for messages

Unsubscribes from a single topic.

Arguments

topic The topic to unsubscribe. It must match a topic from a previous subscribe.

Unsubscribes from multiple topics simultaneously.

Arguments

topic The topics to unsubscribe. Each must match a topic from a previous subscribe.

Start consuming incoming messages. This initializes the client to receive messages into an internal queue which can be read synchronously.

Trait Implementations

impl Drop for AsyncClient
[src]

A method called when the value goes out of scope. Read more