pub struct Mqtt { /* private fields */ }Expand description
The publishing half.
Implementations§
Source§impl Mqtt
impl Mqtt
Sourcepub fn publish(
&self,
topic: impl Into<String>,
payload: impl Into<Vec<u8>>,
retain: bool,
)
pub fn publish( &self, topic: impl Into<String>, payload: impl Into<Vec<u8>>, retain: bool, )
Publishes; a full queue drops the message rather than stall the radio.
Sourcepub async fn publish_reliable(
&self,
topic: impl Into<String>,
payload: impl Into<Vec<u8>>,
retain: bool,
)
pub async fn publish_reliable( &self, topic: impl Into<String>, payload: impl Into<Vec<u8>>, retain: bool, )
Publishes reliably (QoS 1), waiting for room in the queue.
Sourcepub fn publish_json(
&self,
topic: impl Into<String>,
value: &Value,
retain: bool,
)
pub fn publish_json( &self, topic: impl Into<String>, value: &Value, retain: bool, )
Publishes JSON.
Sourcepub async fn disconnect(&self)
pub async fn disconnect(&self)
Disconnects 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