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 fn send_at_least_once(
self,
) -> impl Future<Output = Result<PublishAck, SendPacketError>>
pub fn send_at_least_once( self, ) -> impl Future<Output = Result<PublishAck, SendPacketError>>
Send publish packet with QoS 1
sourcepub fn send_at_least_once_no_block(self) -> Result<(), SendPacketError>
pub fn send_at_least_once_no_block(self) -> Result<(), SendPacketError>
Non-blocking send publish packet with QoS 1
Panics if sink is not ready or publish ack callback is not set
Auto Trait Implementations§
impl Freeze for PublishBuilder
impl !RefUnwindSafe for PublishBuilder
impl !Send for PublishBuilder
impl !Sync for PublishBuilder
impl Unpin for PublishBuilder
impl !UnwindSafe for PublishBuilder
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