Struct paho_mqtt::connect_options::ConnectOptionsBuilder
[−]
[src]
pub struct ConnectOptionsBuilder { /* fields omitted */ }
Methods
impl ConnectOptionsBuilder
[src]
fn new() -> ConnectOptionsBuilder
fn keep_alive_interval(
&mut self,
keep_alive_interval: Duration
) -> &mut ConnectOptionsBuilder
&mut self,
keep_alive_interval: Duration
) -> &mut 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.
fn clean_session(&mut self, clean: bool) -> &mut ConnectOptionsBuilder
Sets the 'clean session' flag to send to the broker.
Arguments
clean
Whether the broker should remove any previously-stored
information for this client.
fn max_inflight(&mut self, max_inflight: i32) -> &mut ConnectOptionsBuilder
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.
fn will_options(&mut self, will: WillOptions) -> &mut ConnectOptionsBuilder
fn ssl_options(&mut self, ssl: SslOptions) -> &mut ConnectOptionsBuilder
fn user_name(&mut self, user_name: &str) -> &mut ConnectOptionsBuilder
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.
fn password(&mut self, password: &str) -> &mut ConnectOptionsBuilder
Sets the password for authentication with the broker. This works with the user name.
Arguments
password
The password to send to the broker.
fn connect_timeout(&mut self, timeout: Duration) -> &mut ConnectOptionsBuilder
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.
fn retry_interval(&mut self, interval: Duration) -> &mut ConnectOptionsBuilder
fn server_uris(
&mut self,
server_uris: Vec<String>
) -> &mut ConnectOptionsBuilder
&mut self,
server_uris: Vec<String>
) -> &mut ConnectOptionsBuilder
Specify the servers to which the client will connect.
Arguments
server_uris
The addresses of the brokers to which this client
should connect.
fn mqtt_version(&mut self, ver: u32) -> &mut ConnectOptionsBuilder
Sets the version of MQTT to use on the connect.
Arguments
ver
The version of MQTT to use when connecting to the broker.
* (0) try the latest version (3.1.1) and work backwards
* (3) only try v3.1
* (4) only try v3.1.1
fn automatic_reconnect(
&mut self,
min_retry_interval: Duration,
max_retry_interval: Duration
) -> &mut ConnectOptionsBuilder
&mut self,
min_retry_interval: Duration,
max_retry_interval: Duration
) -> &mut ConnectOptionsBuilder
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.
fn finalize(&self) -> ConnectOptions
Finalize the builder to create the connect options.