pub struct PublishFlags(/* private fields */);
Expand description
This struct allows the developer to create and parse valid publish flags. See MQTT v3 protocol for more information.
Implementations§
Source§impl PublishFlags
impl PublishFlags
Sourcepub const fn new(dup: bool, qos: QoS, retain: bool) -> Self
pub const fn new(dup: bool, qos: QoS, retain: bool) -> Self
Instantiates a new set of publish flags with the specified values:
dup
indicates that the message was already sent by the client before, but is about to be re-transmitted due to a lack of acknowledgment from the brokerqos
indicates the quality of service that will be used to send the messageretain
indicates that the message should be stored by the broker and transmitted when clients subscribe to the corresponding topic
Sourcepub const fn was_retained(self) -> bool
pub const fn was_retained(self) -> bool
Indicates that the message was a retained message that is being transmitted by the broker in response to a topic subscription.
Sourcepub const fn qos(self) -> QoS
pub const fn qos(self) -> QoS
Indicates the quality of service used to receive the message. The client that sent the message initially might have used a different quality of service to transmit it.
Sourcepub const fn is_dup(self) -> bool
pub const fn is_dup(self) -> bool
Indicates that this publish packet was already sent by the broker before, but was re-transmitted due to a lack of acknowledgment from the client.
Sourcepub const fn into_inner(self) -> u8
pub const fn into_inner(self) -> u8
Converts the flags into their raw byte form.
Trait Implementations§
Source§impl Clone for PublishFlags
impl Clone for PublishFlags
Source§fn clone(&self) -> PublishFlags
fn clone(&self) -> PublishFlags
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl PartialEq for PublishFlags
impl PartialEq for PublishFlags
Source§impl TryFrom<u8> for PublishFlags
impl TryFrom<u8> for PublishFlags
impl Copy for PublishFlags
impl Eq for PublishFlags
impl StructuralPartialEq for PublishFlags
Auto Trait Implementations§
impl Freeze for PublishFlags
impl RefUnwindSafe for PublishFlags
impl Send for PublishFlags
impl Sync for PublishFlags
impl Unpin for PublishFlags
impl UnwindSafe for PublishFlags
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