pub struct PublishOptions { /* private fields */ }Expand description
How one message is published: its quality of service, and whether the broker keeps it.
A retained message is the one the broker hands to every client that subscribes to the topic later, so a new dashboard sees the last reading at once rather than waiting for the next (OASIS MQTT 3.1.1, section 3.3.1.3). Publishing an empty retained message clears the one the broker holds.
Implementations§
Source§impl PublishOptions
impl PublishOptions
Sourcepub fn new() -> PublishOptions
pub fn new() -> PublishOptions
Sourcepub fn qos(self, qos: QualityOfService) -> PublishOptions
pub fn qos(self, qos: QualityOfService) -> PublishOptions
Sourcepub fn retained(self) -> PublishOptions
pub fn retained(self) -> PublishOptions
Has the broker retain the message for clients that subscribe later.
§Returns
The updated options, for chaining.
Sourcepub fn is_retained(&self) -> bool
pub fn is_retained(&self) -> bool
Trait Implementations§
Source§impl Clone for PublishOptions
impl Clone for PublishOptions
Source§fn clone(&self) -> PublishOptions
fn clone(&self) -> PublishOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PublishOptions
Source§impl Debug for PublishOptions
impl Debug for PublishOptions
Source§impl Default for PublishOptions
impl Default for PublishOptions
Source§fn default() -> PublishOptions
fn default() -> PublishOptions
Returns the “default value” for a type. Read more
impl Eq for PublishOptions
Source§impl PartialEq for PublishOptions
impl PartialEq for PublishOptions
impl StructuralPartialEq for PublishOptions
Auto Trait Implementations§
impl Freeze for PublishOptions
impl RefUnwindSafe for PublishOptions
impl Send for PublishOptions
impl Sync for PublishOptions
impl Unpin for PublishOptions
impl UnsafeUnpin for PublishOptions
impl UnwindSafe for PublishOptions
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