pub struct Mqtt { /* private fields */ }Expand description
A cloneable publisher.
Implementations§
Source§impl Mqtt
impl Mqtt
Sourcepub async fn publish(
&self,
topic: impl Into<String>,
payload: impl Into<Vec<u8>>,
retain: bool,
)
pub async fn publish( &self, topic: impl Into<String>, payload: impl Into<Vec<u8>>, retain: bool, )
Publish without blocking the caller on the broker.
Sourcepub async fn publish_json(
&self,
topic: impl Into<String>,
value: &Value,
retain: bool,
)
pub async fn publish_json( &self, topic: impl Into<String>, value: &Value, retain: bool, )
Publish JSON.
Sourcepub async fn disconnect(&self)
pub async fn disconnect(&self)
Disconnect cleanly (the will is not sent).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mqtt
impl RefUnwindSafe for Mqtt
impl Send for Mqtt
impl Sync for Mqtt
impl Unpin for Mqtt
impl UnsafeUnpin for Mqtt
impl UnwindSafe for Mqtt
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