Struct poster::ConnectOpts

source ·
pub struct ConnectOpts<'a> { /* private fields */ }
Expand description

Connection options, represented as a consuming builder. Used during connection request, translated to the CONNECT packet.

Implementations§

Creates a new ConnectOpts instance.

Sets the client identifier.

Sets the session keep alive.

Arguments

val - Duration value less than u16::MAX in seconds.

Panics

When the duration in seconds is greater than u16::MAX.

Sets the session expiry interval.

Arguments

val - Duration value less than u32::MAX in seconds.

Panics

When the duration in seconds is greater than u32::MAX.

Sets the maximum incoming QoS>0 publish messages handled at once.

Arguments

val - value greater than 0

Panics

When val equals 0.

Sets the maximum packet size (in bytes).

Arguments

val - value greater than 0

Panics

When val equals 0.

Sets the maximum accepted value of topic alias.

Requests the broker to return response information in ConnectRsp.

Requests the broker to return additional diagnostic data (reason string, user properties) in ConnectRsp.

Sets the name of the authentication method used for extended authorization.

Sets the binary authentication data. Note that setting authentication data without authentication_method set will result in an error.

Sets user properties as key-value pairs. Multiple user properties may be set.

QoS used for will messages.

Retain for will messages.

Clears the session upon connection.

Sets delay before publishing will messages.

Arguments

val - Duration value less than u32::MAX in seconds.

Panics

When the duration in seconds is greater than u32::MAX.

Sets payload format indicator for will messages. Value false indicates that the will payload is in unspecified format. Value true indicates that the payload is UTF8 encoded character data.

Sets the expiry interval of the will messages.

Arguments

val - Duration value less than u32::MAX in seconds.

Panics

When the duration in seconds is greater than u32::MAX.

Sets the content type of will messages.

Sets the response topic for will messages.

Sets the correlation data for will messages.

Sets user properties for will messages as key-value pairs. Multiple user properties may be set.

Sets the topic for will messages.

Sets the binary payload for will messages.

Sets the username for normal authorization.

Sets the password for normal authorization.

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.