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

The collection of options for connecting to a broker.

This can be constructed using a ConnectOptionsBuilder to set all the options.

Implementations

Creates a new, default set of connect options.

Gets the MQTT protocol version that should be used for the connection.

Sets the MQTT protocol version that should be used for the connection.

This also insures that the other options are compatible with the selected version. For example, when setting for v5, it will make sure the cleansession flag is cleared, since v5 uses cleanstart, not cleansession.

Gets the “clean session” setting in the options.

This is only used in MQTT v3 connections.

This sets the “clean session” behavior for connecting to the server.

When set to true, this directs the server to throw away any state related to the client, as determined by the client identifier. When set to false, the server keeps the state information and resumes the previous session.

This is only used in MQTT v3 connections.

Gets the “clean start” setting in the options.

This is only used in MQTT v5 connections.

This sets the “clean start” behavior for connecting to the server.

When set to true, this directs the server to throw away any state related to the client, as determined by the client identifier. When set to false, the server keeps the state information and resumes the previous session.

This is only used in MQTT v5 connections.

Sets the token to ber used for connect completion callbacks.

Note that we leak the token to give to the C lib. When we’re done with it, we must recover and drop it (i.e. in the completion callback).

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

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.