[][src]Struct sage_mqtt::Will

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<String>,
    pub correlation_data: Option<Vec<u8>>,
    pub user_properties: Vec<(String, String)>,
    pub topic: String,
    pub message: Vec<u8>,
}

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 broket will wait after a deconnction 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<String>

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: String

The Last Will Topic. Cannot be empty.

message: Vec<u8>

The last will payload.

Trait Implementations

impl Clone for Will[src]

impl Debug for Will[src]

impl Default for Will[src]

impl PartialEq<Will> for Will[src]

impl StructuralPartialEq for Will[src]

Auto Trait Implementations

impl RefUnwindSafe for Will

impl Send for Will

impl Sync for Will

impl Unpin for Will

impl UnwindSafe for Will

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.