pub struct Will {
pub properties: Option<WillProperties>,
pub topic: String,
pub payload: Bytes,
pub qos: QoS,
pub retain: bool,
}Expand description
Represents a Last Will and Testament (LWT) message in MQTT v5.
The Will message is published by the broker when the client disconnects unexpectedly. It includes the message content, delivery options, and MQTT v5 properties that provide additional control over the will message delivery.
§Example
use mqute_codec::protocol::v5::Will;
use bytes::Bytes;
use mqute_codec::protocol::QoS;
let will = Will::new(None, "/topic", Bytes::new(), QoS::ExactlyOnce, false);Fields§
§properties: Option<WillProperties>Will message properties
topic: StringTopic name to publish the Will message to
payload: BytesWill message payload
qos: QoSQuality of Service level for the Will message
retain: boolWhether the Will message should be retained
Implementations§
Trait Implementations§
impl Eq for Will
impl StructuralPartialEq for Will
Auto Trait Implementations§
impl !Freeze for Will
impl RefUnwindSafe for Will
impl Send for Will
impl Sync for Will
impl Unpin for Will
impl UnwindSafe for Will
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