Struct poster::ContextHandle

source ·
pub struct ContextHandle { /* private fields */ }
Expand description

Cloneable handle to the client Context. The ContextHandle object is used to perform MQTT operations.

Implementations§

Performs graceful disconnection with the broker by sending the Disconnect packet.

Sends ping to the broker by sending Ping packet. This method MUST be called periodically if session_expiry_interval was set during connection request in order to maintain the session.

Publish data with the parameters set in PublishOpts. Acknowledgement of QoS>0 messages is handled automatically.

Errors

Performs subscription to the topics specified in opts. This corresponds to sending the Subscribe packet.

QoS>0 messages are acknowledged automatically.

On success returns SubscribeRsp object containing the acknowledgment data from the broker. This object can be transformed into the asynchronous stream of messages published to the subscribed topics by using the stream method.

Errors

Per-topic reason codes are retrieved with the payload method.

Unsubscribes from the topics specified in opts. This corresponds to sending the Unsubscribe packet.

Errors

Per-topic reason codes are retrieved with the payload method.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. 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
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.