pub struct TypedLastWill<T> {
pub payload: T,
pub qos: QoS,
pub retain: bool,
pub topic: String,
}
Expand description
Represents a Last Will and Testament (LWT) message for MQTT clients.
Fields§
§payload: T
The payload of the LWT message.
qos: QoS
The Quality of Service level for the LWT message.
retain: bool
Whether the LWT message should be retained by the broker.
topic: String
The topic to which the LWT message will be published.
Implementations§
Source§impl<T> TypedLastWill<T>
impl<T> TypedLastWill<T>
Sourcepub fn new(topic: String, payload: T) -> TypedLastWill<T>
pub fn new(topic: String, payload: T) -> TypedLastWill<T>
Creates a new Last Will and Testament message.
Sourcepub fn qos(self, qos: QoS) -> TypedLastWill<T>
pub fn qos(self, qos: QoS) -> TypedLastWill<T>
Sets the QoS level for the LWT message.
Sourcepub fn retain(self, retain: bool) -> TypedLastWill<T>
pub fn retain(self, retain: bool) -> TypedLastWill<T>
Sets the retain flag for the LWT message.
Auto Trait Implementations§
impl<T> Freeze for TypedLastWill<T>where
T: Freeze,
impl<T> RefUnwindSafe for TypedLastWill<T>where
T: RefUnwindSafe,
impl<T> Send for TypedLastWill<T>where
T: Send,
impl<T> Sync for TypedLastWill<T>where
T: Sync,
impl<T> Unpin for TypedLastWill<T>where
T: Unpin,
impl<T> UnwindSafe for TypedLastWill<T>where
T: UnwindSafe,
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