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

Builder to create the options for disconnecting from an MQTT server.

Implementations

Create a new DisconnectOptionsBuilder

Sets the time interval to allow the disconnect to complete. This specifies the time to allow in-flight messages to complete.

Arguments

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

Set the reason for the disconnect.

The valid disconnect reasons are listed here in the spec: https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901208

Tell the server to publish the will message on this disconnect.

This sets the reason code in the options to 0x04: “Disconnect with Will Message”

Sets the collection of properties for the disconnect.

Arguments

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

Finalize the builder to create the disconnect options.

Trait Implementations

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