pub struct ClientShutdownHandle { /* private fields */ }Expand description
An owned handle that can be used to disconnect and shutdown an MQTT client’s
transceiver task and obtain its ShutdownStatus.
Should this value be dropped without calling ClientShutdownHandle::disconnect()
beforehand, the client’s transceiver task will be detached.
Implementations§
Source§impl ClientShutdownHandle
impl ClientShutdownHandle
Sourcepub async fn disconnect(self) -> Result<ShutdownStatus, JoinError>
pub async fn disconnect(self) -> Result<ShutdownStatus, JoinError>
Enqueues a disconnect command, causing the transceiver task to attempt to disconnect gracefully
and shutdown. Unlike Client::disconnect(), this function will wait for the transceiver task
to complete before returning, and also returns a ShutdownStatus, which can be used to know
whether the client managed to disconnect gracefully or not.
Pending publish packets may not be sent, and existing subscriptions will be closed.
Auto Trait Implementations§
impl Freeze for ClientShutdownHandle
impl RefUnwindSafe for ClientShutdownHandle
impl Send for ClientShutdownHandle
impl Sync for ClientShutdownHandle
impl Unpin for ClientShutdownHandle
impl UnwindSafe for ClientShutdownHandle
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