Struct lmc::PublishFlags
source · pub struct PublishFlags(_);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:
dupindicates 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 brokerqosindicates the quality of service that will be used to send the messageretainindicates 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 copy 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<PublishFlags> for PublishFlags
impl PartialEq<PublishFlags> for PublishFlags
source§fn eq(&self, other: &PublishFlags) -> bool
fn eq(&self, other: &PublishFlags) -> bool
This method tests for
self and other values to be equal, and is used
by ==.