pub struct MqttTransport { /* private fields */ }Expand description
Implementations§
Source§impl MqttTransport
impl MqttTransport
Sourcepub fn new(config: MqttConfig) -> Self
pub fn new(config: MqttConfig) -> Self
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Reports whether the transport currently holds an active connection.
§Returns
true once connect has succeeded and before
disconnect is called.
Sourcepub async fn disconnect(&mut self) -> Result<()>
pub async fn disconnect(&mut self) -> Result<()>
Closes the connection and stops the background event loop.
Calling this on a transport that is not connected is a no-op.
§Returns
Ok(()) once the disconnect request has been issued and the event loop
task has been stopped.
§Errors
This call is best-effort and does not surface broker errors raised while
tearing down, so it currently always returns Ok(()).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MqttTransport
impl RefUnwindSafe for MqttTransport
impl Send for MqttTransport
impl Sync for MqttTransport
impl Unpin for MqttTransport
impl UnsafeUnpin for MqttTransport
impl UnwindSafe for MqttTransport
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