Struct mqtt_async_client::client::Client[][src]

pub struct Client { /* fields omitted */ }
Expand description

An MQTT client.

Start building an instance by calling Client::builder() to get a ClientBuilder, using the fluent builder pattern on ClientBuilder, then calling ClientBuilder::build(). For example:

let client =
    Client::builder()
       .set_url_string("mqtt://example.com").unwrap()
       .build();

Client is expected to be Send (passable between threads), but not Sync (usable by multiple threads at the same time).

Implementations

Start a fluent builder interface to construct a Client.

Open a connection to the configured MQTT broker.

Publish some data on a topic.

Note that this method takes &self. This means a caller can create several publish futures to publish several payloads of data simultaneously without waiting for responses.

Subscribe to some topics.read_subscriptions will return data for them.

Unsubscribe from some topics. read_subscriptions will no longer return data for them.

Wait for the next Publish packet for one of this Client’s subscriptions.

Gracefully close the connection to the server.

Trait Implementations

Formats the value using the given formatter. Read more

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 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.