WillProperties

Struct WillProperties 

Source
pub struct WillProperties<'a> {
    pub payload_format_indicator: Option<u8>,
    pub message_expiry_interval: Option<u32>,
    pub content_type: Option<&'a str>,
    pub response_topic: Option<&'a str>,
    pub correlation_data: Option<&'a [u8]>,
    pub delay_interval: Option<u32>,
    pub user_properties: Vec<(&'a str, &'a str), 32>,
}
Expand description

The Will Properties field defines the Application Message properties to be sent with the Will Message when it is published, and properties which define when to publish the Will Message.

MQTT5 SPECIFICATION

Fields§

§payload_format_indicator: Option<u8>

1 (0x01) Byte, Identifier of the Payload Format Indicator.

Followed by the value of the Payload Format Indicator, either of:

  • 0 (0x00) Byte Indicates that the Will Message is unspecified bytes, which is equivalent to not sending a Payload Format Indicator.
  • 1 (0x01) Byte Indicates that the Will Message is UTF-8 Encoded Character Data.
§message_expiry_interval: Option<u32>

2 (0x02) Byte, Identifier of the Message Expiry Interval.

Followed by the Four Byte Integer representing the Message Expiry Interval.

§content_type: Option<&'a str>

3 (0x03) Identifier of the Content Type.

Followed by a UTF-8 Encoded String describing the content of the Will Message.

§response_topic: Option<&'a str>

8 (0x08) Byte, Identifier of the Response Topic.

Followed by a UTF-8 Encoded String which is used as the Topic Name for a response message.

§correlation_data: Option<&'a [u8]>

9 (0x09) Byte, Identifier of the Correlation Data.

Followed by Binary Data. The Correlation Data is used by the sender of the Request Message to identify which request the Response Message is for when it is received.

§delay_interval: Option<u32>

24 (0x18) Byte, Identifier of the Will Delay Interval.

Followed by the Four Byte Integer representing the Will Delay Interval in seconds.

§user_properties: Vec<(&'a str, &'a str), 32>

38 (0x26) Byte, Identifier of the User Property.

Followed by a UTF-8 String Pair.

Implementations§

Source§

impl<'a> WillProperties<'a>

Source

pub fn read( buf: &'a [u8], offset: &mut usize, ) -> Result<Option<Self>, MqttError>

Source

pub fn write(&self, buf: &mut [u8], offset: &mut usize) -> Result<(), MqttError>

Trait Implementations§

Source§

impl<'a> Clone for WillProperties<'a>

Source§

fn clone(&self) -> WillProperties<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for WillProperties<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for WillProperties<'a>

Source§

fn default() -> WillProperties<'a>

Returns the “default value” for a type. Read more
Source§

impl<'a> PartialEq for WillProperties<'a>

Source§

fn eq(&self, other: &WillProperties<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> StructuralPartialEq for WillProperties<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for WillProperties<'a>

§

impl<'a> RefUnwindSafe for WillProperties<'a>

§

impl<'a> Send for WillProperties<'a>

§

impl<'a> Sync for WillProperties<'a>

§

impl<'a> Unpin for WillProperties<'a>

§

impl<'a> UnwindSafe for WillProperties<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.