Struct ntex_mqtt::v5::PublishBuilder
source · pub struct PublishBuilder { /* private fields */ }
Implementations§
source§impl PublishBuilder
impl PublishBuilder
sourcepub fn packet_id(self, id: u16) -> Self
pub fn packet_id(self, id: u16) -> Self
Set packet id.
Note: if packet id is not set, it gets generated automatically. Packet id management should not be mixed, it should be auto-generated or set by user. Otherwise collisions could occure.
panics if id is 0
sourcepub fn dup(self, val: bool) -> Self
pub fn dup(self, val: bool) -> Self
This might be re-delivery of an earlier attempt to send the Packet.
sourcepub fn properties<F>(self, f: F) -> Selfwhere
F: FnOnce(&mut PublishProperties),
pub fn properties<F>(self, f: F) -> Selfwhere
F: FnOnce(&mut PublishProperties),
Set publish packet properties
sourcepub fn set_properties<F>(&mut self, f: F)where
F: FnOnce(&mut PublishProperties),
pub fn set_properties<F>(&mut self, f: F)where
F: FnOnce(&mut PublishProperties),
Set publish packet properties
sourcepub fn send_at_most_once(self) -> Result<(), SendPacketError>
pub fn send_at_most_once(self) -> Result<(), SendPacketError>
Send publish packet with QoS 0
sourcepub async fn send_at_least_once(self) -> Result<PublishAck, SendPacketError>
pub async fn send_at_least_once(self) -> Result<PublishAck, SendPacketError>
Send publish packet with QoS 1