Property

Enum Property 

pub enum Property<'a> {
Show 27 variants PayloadFormatIndicator(PayloadFormat), MessageExpiryInterval(u32), ContentType(&'a MqttStr), ResponseTopic(&'a Topic), CorrelationData(&'a MqttBytes), SubscriptionIdentifier(NonZeroVbi), SessionExpiryInterval(u32), AssignedClientIdentifier(&'a MqttStr), ServerKeepAlive(u16), AuthenticationMethod(&'a MqttStr), AuthenticationData(&'a MqttBytes), RequestProblemInformation(bool), WillDelayInterval(u32), RequestResponseInformation(bool), ResponseInformation(&'a MqttStr), ServerReference(&'a MqttStr), ReasonString(&'a MqttStr), ReceiveMaximum(NonZeroU16), TopicAliasMaximum(u16), TopicAlias(NonZeroU16), MaximumQoS(QoS), RetainAvailable(bool), UserProperty(&'a MqttStr, &'a MqttStr), MaximumPacketSize(NonZeroU32), WildcardSubscriptionAvailable(bool), SubscriptionIdentifierAvailable(bool), SharedSubscriptionAvailable(bool),
}
Expand description

A typed MQTT v5 property. Each variant statically guarantees the correct value type for the property identifier.

Variants§

§

PayloadFormatIndicator(PayloadFormat)

§3.3.2.3.2 — 0 = unspecified bytes, 1 = UTF-8.

§

MessageExpiryInterval(u32)

Message expiry interval in seconds.

§

ContentType(&'a MqttStr)

MIME content type of the payload.

§

ResponseTopic(&'a Topic)

Response topic for request/response pattern.

§

CorrelationData(&'a MqttBytes)

Correlation data for request/response matching.

§

SubscriptionIdentifier(NonZeroVbi)

Encoded as a Variable Byte Integer on the wire; must be 1–268 435 455.

§

SessionExpiryInterval(u32)

Session expiry interval in seconds.

§

AssignedClientIdentifier(&'a MqttStr)

Client identifier assigned by the server.

§

ServerKeepAlive(u16)

Server-specified keep-alive interval in seconds.

§

AuthenticationMethod(&'a MqttStr)

Authentication method name.

§

AuthenticationData(&'a MqttBytes)

Authentication data.

§

RequestProblemInformation(bool)

§3.1.2.11.7 — false = 0, true = 1.

§

WillDelayInterval(u32)

Will delay interval in seconds.

§

RequestResponseInformation(bool)

§3.1.2.11.6 — false = 0, true = 1.

§

ResponseInformation(&'a MqttStr)

Reference to response information string.

§

ServerReference(&'a MqttStr)

Server reference for redirection.

§

ReasonString(&'a MqttStr)

Human-readable reason string.

§

ReceiveMaximum(NonZeroU16)

§3.2.2.3.3 — must not be zero.

§

TopicAliasMaximum(u16)

Maximum topic alias value the receiver accepts.

§

TopicAlias(NonZeroU16)

§3.3.2.3.4 — must not be zero.

§

MaximumQoS(QoS)

§3.2.2.3.4 — only QoS 0 or 1 are valid on the wire.

§

RetainAvailable(bool)

§3.2.2.3.5 — false = 0, true = 1.

§

UserProperty(&'a MqttStr, &'a MqttStr)

User-defined key-value pair.

§

MaximumPacketSize(NonZeroU32)

§3.2.2.3.6 — must not be zero.

§

WildcardSubscriptionAvailable(bool)

§3.2.2.3.12 — false = 0, true = 1.

§

SubscriptionIdentifierAvailable(bool)

§3.2.2.3.13 — false = 0, true = 1.

§

SharedSubscriptionAvailable(bool)

§3.2.2.3.14 — false = 0, true = 1.

Implementations§

§

impl Property<'_>

pub const fn id(&self) -> PropertyId

Returns the property identifier for this property.

pub const fn encoded_len(&self) -> usize

Encoded byte length of this property on the wire (id VBI + value).

Trait Implementations§

§

impl<'a> Clone for Property<'a>

§

fn clone(&self) -> Property<'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
§

impl<'a> Debug for Property<'a>

§

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

Formats the value using the given formatter. Read more
§

impl<'a> PartialEq for Property<'a>

§

fn eq(&self, other: &Property<'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.
§

impl<'a> Copy for Property<'a>

§

impl<'a> Eq for Property<'a>

§

impl<'a> StructuralPartialEq for Property<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Property<'a>

§

impl<'a> RefUnwindSafe for Property<'a>

§

impl<'a> Send for Property<'a>

§

impl<'a> Sync for Property<'a>

§

impl<'a> Unpin for Property<'a>

§

impl<'a> UnwindSafe for Property<'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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.