Enum PropertyId

Source
#[repr(u8)]
pub enum PropertyId {
Show 27 variants PayloadFormatIndicator = 1, MessageExpiryInterval = 2, ContentType = 3, ResponseTopic = 8, CorrelationData = 9, SubscriptionIdentifier = 11, SessionExpiryInterval = 17, AssignedClientIdentifier = 18, ServerKeepAlive = 19, AuthenticationMethod = 21, AuthenticationData = 22, RequestProblemInformation = 23, WillDelayInterval = 24, RequestResponseInformation = 25, ResponseInformation = 26, ServerReference = 28, ReasonString = 31, ReceiveMaximum = 33, TopicAliasMaximum = 34, TopicAlias = 35, MaximumQos = 36, RetainAvailable = 37, UserProperty = 38, MaximumPacketSize = 39, WildcardSubscriptionAvailable = 40, SubscriptionIdentifierAvailable = 41, SharedSubscriptionAvailable = 42,
}
Expand description

MQTT v5.0 Property Identifiers

This enum represents all property identifiers defined in the MQTT v5.0 specification. Properties are used to extend MQTT packets with additional metadata and control information.

Each property has a unique identifier (1-42) and is associated with specific packet types. Properties provide enhanced functionality such as message expiry, user properties, authentication data, and various server capabilities.

§Specification Reference

See MQTT v5.0 Properties for detailed information about each property.

§Examples

use mqtt_protocol_core::mqtt;

let property_id = mqtt::packet::PropertyId::MessageExpiryInterval;
assert_eq!(property_id.as_u8(), 2);
assert_eq!(property_id.as_str(), "message_expiry_interval");

Variants§

§

PayloadFormatIndicator = 1

Indicates the format of the payload in PUBLISH packets (0=binary, 1=UTF-8)

§

MessageExpiryInterval = 2

Message expiry interval in seconds

§

ContentType = 3

Content type of the application message

§

ResponseTopic = 8

Topic name for response messages

§

CorrelationData = 9

Correlation data for request/response messaging

§

SubscriptionIdentifier = 11

Subscription identifier for matching subscriptions

§

SessionExpiryInterval = 17

Session expiry interval in seconds

§

AssignedClientIdentifier = 18

Client identifier assigned by the server

§

ServerKeepAlive = 19

Keep alive time assigned by the server

§

AuthenticationMethod = 21

Authentication method name

§

AuthenticationData = 22

Authentication data

§

RequestProblemInformation = 23

Request problem information flag

§

WillDelayInterval = 24

Will delay interval in seconds

§

RequestResponseInformation = 25

Request response information flag

§

ResponseInformation = 26

Response information string

§

ServerReference = 28

Server reference for redirection

§

ReasonString = 31

Human readable reason string

§

ReceiveMaximum = 33

Maximum number of concurrent PUBLISH packets

§

TopicAliasMaximum = 34

Maximum topic alias value

§

TopicAlias = 35

Topic alias value

§

MaximumQos = 36

Maximum QoS level supported

§

RetainAvailable = 37

Retain availability flag

§

UserProperty = 38

User-defined property key-value pair

§

MaximumPacketSize = 39

Maximum packet size

§

WildcardSubscriptionAvailable = 40

Wildcard subscription availability flag

§

SubscriptionIdentifierAvailable = 41

Subscription identifier availability flag

§

SharedSubscriptionAvailable = 42

Shared subscription availability flag

Implementations§

Source§

impl PropertyId

Source

pub fn as_u8(self) -> u8

Get the numeric identifier of the property

Returns the property identifier as defined in the MQTT v5.0 specification.

§Examples
use mqtt_protocol_core::mqtt;

let prop = mqtt::packet::PropertyId::MessageExpiryInterval;
assert_eq!(prop.as_u8(), 2);
Source

pub fn as_str(&self) -> &'static str

Get the string representation of the property identifier

Returns a human-readable string name for the property, suitable for serialization and debugging purposes.

§Examples
use mqtt_protocol_core::mqtt;

let prop = mqtt::packet::PropertyId::ContentType;
assert_eq!(prop.as_str(), "content_type");

Trait Implementations§

Source§

impl Clone for PropertyId

Source§

fn clone(&self) -> PropertyId

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 Debug for PropertyId

Source§

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

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

impl<'de> Deserialize<'de> for PropertyId

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for PropertyId

Source§

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

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

impl PartialEq for PropertyId

Source§

fn eq(&self, other: &PropertyId) -> 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 Serialize for PropertyId

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFrom<u8> for PropertyId

Source§

type Error = TryFromPrimitiveError<PropertyId>

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

fn try_from(number: u8) -> Result<Self, TryFromPrimitiveError<Self>>

Performs the conversion.
Source§

impl TryFromPrimitive for PropertyId

Source§

impl Copy for PropertyId

Source§

impl Eq for PropertyId

Source§

impl StructuralPartialEq for PropertyId

Auto Trait Implementations§

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> AsConcrete<T> for T

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoConcreteOwned<T> for T

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,