pub struct MqttConnection { /* private fields */ }
Expand description
MQTT connection handle for lifecycle management
This type manages the connection lifecycle and provides graceful shutdown. It should be kept alive for the duration of the MQTT session.
Implementations§
Source§impl MqttConnection
impl MqttConnection
Sourcepub async fn shutdown(self) -> Result<(), MqttClientError>
pub async fn shutdown(self) -> Result<(), MqttClientError>
Gracefully shutdown the MQTT connection by:
- Shutting down subscription manager (sends unsubscribe commands for all topics)
- Sending MQTT Disconnect packet (triggers event loop termination)
- Waiting for event loop to finish processing
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MqttConnection
impl !RefUnwindSafe for MqttConnection
impl Send for MqttConnection
impl Sync for MqttConnection
impl Unpin for MqttConnection
impl !UnwindSafe for MqttConnection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more