Struct sage_mqtt::Will [−][src]
pub struct Will {
pub qos: QoS,
pub retain: bool,
pub delay_interval: u32,
pub payload_format_indicator: bool,
pub message_expiry_interval: Option<u32>,
pub content_type: String,
pub response_topic: Option<Topic>,
pub correlation_data: Option<Vec<u8>>,
pub user_properties: Vec<(String, String)>,
pub topic: Topic,
pub message: Vec<u8>,
}
Expand description
Due to the unstable nature of a connexion, the client can loose its connection to the server. This ungraceful disconnect can be notified to every other clients by specifying a Last Will message that is given upon connection. When a client ungracefully disconnect from a server (when the keep alive is reached), the server will publish the Last Will message to anyone subscribed to its topic.
Fields
qos: QoS
The quality of service for the will message.
retain: bool
If the message is to be retained. A retain message is kept in memory by a broker (one per topic) to sent to future subscriptions.
delay_interval: u32
Delay in seconds the broker will wait after a deconnection before publishing the will message. The will message can also be published at session expires if it happens first.
payload_format_indicator: bool
If true, the will message will be a valid UTF-8 encoded string. If not the will message can be anything, even a unicorn.
message_expiry_interval: Option<u32>
Corresponds to the expiry interval of the Publish
message sent.
content_type: String
Describes the type of content of the payload. Is generally a MIME descriptor.
response_topic: Option<Topic>
Optional topic used as response if the Will message is a request.
correlation_data: Option<Vec<u8>>
Optional correlation optionaly used if the Will message is a request.
user_properties: Vec<(String, String)>
General purpose properties
topic: Topic
The Last Will Topic. Cannot be empty.
message: Vec<u8>
The last will payload.
Implementations
Builds a default Will with specified topic and message
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Will
impl UnwindSafe for Will
Blanket Implementations
Mutably borrows from an owned value. Read more