[][src]Struct paho_mqtt::connect_options::ConnectOptionsBuilder

pub struct ConnectOptionsBuilder { /* fields omitted */ }

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

Implementations

impl ConnectOptionsBuilder[src]

pub fn new() -> Self[src]

Creates a new ConnectOptionsBuilder

pub fn keep_alive_interval(
    &mut self,
    keep_alive_interval: Duration
) -> &mut Self
[src]

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.

pub fn clean_session(&mut self, clean: bool) -> &mut Self[src]

Sets the 'clean session' flag to send to the broker.

This is for MQTT v3.x connections, only.

Arguments

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

pub fn clean_start(&mut self, clean: bool) -> &mut Self[src]

Sets the 'clean start' flag to send to the broker.

This is for MQTT v5 connections only.

Arguments

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

pub fn max_inflight(&mut self, max_inflight: i32) -> &mut Self[src]

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.

pub fn will_options(&mut self, will: WillOptions) -> &mut Self[src]

👎 Deprecated:

Pass in a message with will_message instead

Sets the LWT options for the connection.

Arguments

will The LWT options for the connection.

pub fn will_message(&mut self, will: Message) -> &mut Self[src]

Sets the LWT message for the connection.

Arguments

will The LWT options for the connection.

pub fn ssl_options(&mut self, ssl: SslOptions) -> &mut Self[src]

Sets the SSL options for the connection.

Arguments

ssl The SSL options for the connection.

pub fn user_name<S>(&mut self, user_name: S) -> &mut Self where
    S: Into<String>, 
[src]

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.

pub fn password<S>(&mut self, password: S) -> &mut Self where
    S: Into<String>, 
[src]

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

Arguments

password The password to send to the broker.

pub fn connect_timeout(&mut self, timeout: Duration) -> &mut Self[src]

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.

pub fn retry_interval(&mut self, interval: Duration) -> &mut Self[src]

Sets the retry interval.

Arguments

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

pub fn server_uris<T>(&mut self, server_uris: &[T]) -> &mut Self where
    T: AsRef<str>, 
[src]

Specify the servers to which the client will connect.

Arguments

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

pub fn mqtt_version(&mut self, ver: u32) -> &mut Self[src]

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 * (5) only try v5

pub fn automatic_reconnect(
    &mut self,
    min_retry_interval: Duration,
    max_retry_interval: Duration
) -> &mut Self
[src]

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.

pub fn properties(&mut self, props: Properties) -> &mut Self[src]

Sets the collection of properties for the connections.

Arguments

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

pub fn http_headers<N, V>(&mut self, coll: &[(N, V)]) -> &mut Self where
    N: AsRef<str>,
    V: AsRef<str>, 
[src]

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

pub fn http_proxy<S>(&mut self, proxy: S) -> &mut Self where
    S: Into<String>, 
[src]

Sets an HTTP proxy for websockets.

Arguments

proxy The HTTP proxy

pub fn https_proxy<S>(&mut self, proxy: S) -> &mut Self where
    S: Into<String>, 
[src]

Sets a secure HTTPS proxy for websockets.

Arguments

proxy The HTTPS proxy

pub fn finalize(&self) -> ConnectOptions[src]

Finalize the builder to create the connect options.

Trait Implementations

impl Default for ConnectOptionsBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.