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§

The bit used to indicate a duplicate message

Mask for the QoS bits

The bit used for the retain flag

Mask containing all bits that may consitute valid publish flags

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 broker
  • qos indicates the quality of service that will be used to send the message
  • retain indicates that the message should be stored by the broker and transmitted when clients subscribe to the corresponding topic

Indicates that the message was a retained message that is being transmitted by the broker in response to a topic subscription.

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.

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.

Converts the flags into their raw byte form.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Validates PublishFlags in their raw byte form. If invalid bits are detected, [PacketDecodeError::MalformedPacket] is returned.

The type returned in the event of a conversion error.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.