pub struct ConnectOptionsBuilder { /* private fields */ }
Expand description

Builder to create the options to connect to the MQTT server.

Implementations

Creates a new ConnectOptionsBuilder

Sets the keep alive interval for the client session.

Arguments

keep_alive_interval The maximum time that should pass without communication between the client and server. This has a resolution in seconds.

Sets the ‘clean session’ flag to send to the broker.

This is for MQTT v3.x connections only, and if set, will set the other options to be compatible with v3.

Arguments

clean Whether the broker should remove any previously-stored information for this client.

Sets the ‘clean start’ flag to send to the broker.

This is for MQTT v5 connections only, and if set, will set the other options to be compatible with v5.

Arguments

clean Whether the broker should remove any previously-stored information for this client.

Sets the maximum number of in-flight messages that can be simultaneously handled by this client.

Arguments

max_inflight The maximum number of messages that can be in-flight at any given time with this client.

👎 Deprecated:

Pass in a message with will_message instead

Sets the LWT options for the connection.

Arguments

will The LWT options for the connection.

Sets the LWT message for the connection.

Arguments

will The LWT options for the connection.

Sets the SSL options for the connection.

Arguments

ssl The SSL options for the connection.

Sets the user name for authentication with the broker. This works with the password.

Arguments

user_name The user name to send to the broker.

Sets the password for authentication with the broker. This works with the user name.

Arguments

password The password to send to the broker.

Sets the time interval to allow the connect to complete.

Arguments

timeout The time interval to allow the connect to complete. This has a resolution of seconds.

Sets the retry interval.

Arguments

interval The retry interval. This has a resolution of seconds.

Specify the servers to which the client will connect.

Arguments

server_uris The addresses of the brokers to which this client should connect.

Sets the version of MQTT to use on the connect.

Note that this value can not be greater than the version used to create the client. Specifically, if the client was created for v3, you can not try to connect with v5.

Arguments

ver The version of MQTT to use when connecting to the broker. * (0) try the latest version and work backwards * (3) only try v3.1 * (4) only try v3.1.1 * (5) only try v5

Sets the client to automatically reconnect if the connection is lost.

Arguments

min_retry_interval The minimum retry interval. Doubled on each failed retry. This has a resolution in seconds. max_retry_interval The maximum retry interval. Doubling stops here on failed retries. This has a resolution in seconds.

Sets the collection of properties for the connections.

Arguments

props The collection of properties to include with the connect message.

Sets the additional HTTP headers that will be sent in the WebSocket opening handshake.

Sets an HTTP proxy for websockets.

Arguments

proxy The HTTP proxy

Sets a secure HTTPS proxy for websockets.

Arguments

proxy The HTTPS proxy

Finalize the builder to create the connect options.

Trait Implementations

Returns the “default value” for a type. 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.