pub enum QoS {
AtMostOnce = 0,
AtLeastOnce = 1,
ExactlyOnce = 2,
}Expand description
Quality of Service level enumeration and functionality Represents the Quality of Service (QoS) levels in MQTT.
Variants§
AtMostOnce = 0
QoS level 0: At most once delivery (Fire and Forget).
The message is delivered according to the best efforts of the underlying network. No acknowledgment is sent, and the message is not stored or re-transmitted.
AtLeastOnce = 1
QoS level 1: At least once delivery (Acknowledged Delivery).
The message is assured to arrive but may arrive more than once.
ExactlyOnce = 2
QoS level 2: Exactly once delivery (Assured Delivery).
The message is assured to arrive exactly once.
Trait Implementations§
Source§impl PartialOrd for QoS
impl PartialOrd for QoS
Source§impl TryFrom<u8> for QoS
impl TryFrom<u8> for QoS
Source§fn try_from(value: u8) -> Result<Self, Self::Error>
fn try_from(value: u8) -> Result<Self, Self::Error>
Attempts to convert a numeric value into a QoS enum.
§Errors
Returns an Error::InvalidQos if the value is not a valid QoS level.
§Examples
use mqute_codec::protocol::QoS;
use mqute_codec::Error;
let qos = QoS::try_from(1).unwrap();
assert_eq!(qos, QoS::AtLeastOnce);
let result = QoS::try_from(3);
assert!(result.is_err());impl Copy for QoS
impl Eq for QoS
impl StructuralPartialEq for QoS
Auto Trait Implementations§
impl Freeze for QoS
impl RefUnwindSafe for QoS
impl Send for QoS
impl Sync for QoS
impl Unpin for QoS
impl UnwindSafe for QoS
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