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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.