PropertyCode

Enum PropertyCode 

#[repr(u32)]
pub enum PropertyCode {
Show 27 variants PayloadFormatIndicator = 1, MessageExpiryInterval = 2, ContentType = 3, ResponseTopic = 8, CorrelationData = 9, SubscriptionIdentifier = 11, SessionExpiryInterval = 17, AssignedClientIdentifer = 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, SubscriptionIdentifiersAvailable = 41, SharedSubscriptionAvailable = 42,
}
Expand description

The enumerated codes for the MQTT v5 properties.

The property code defines both the meaning of the value in the property (Correlation Data, Server Keep Alive) and the data type held by the property.

Variants§

§

PayloadFormatIndicator = 1

[Byte, u8] Indicates whether the payload is unspecified, possibly binary (0) or UTF-8 text (1).

§

MessageExpiryInterval = 2

[FouByteInteger, u32] The lifetime of the application message in seconds. The broker is required to delete expired messages that have not been passed to a subscriber.

§

ContentType = 3

[String] Description of the payload. Often the MIME type describing the serialization.

§

ResponseTopic = 8

[String] The topic name for a response message, such as for the RPC pattern.

§

CorrelationData = 9

[Binary] Used by the sender of a request message to identify the response. Typically used with the RPC pattern, or just to identify related messages.

§

SubscriptionIdentifier = 11

[VariableByteInteger] The identifier of the subscription.

§

SessionExpiryInterval = 17

[FourByteInteger, u32] The number of seconds after which the network connection is closed that the server should keep a persistent session.

§

AssignedClientIdentifer = 18

[String] The ClientID assigned by the server when it receives a zero-length ClientID in the CONNECT message.

§

ServerKeepAlive = 19

[TwoByteInteger, u16] The Keep Alive duration that the server requires.

§

AuthenticationMethod = 21

[String] The name of the authentication method.

§

AuthenticationData = 22

[Binary] The authentication data

§

RequestProblemInformation = 23

[Byte, u8] The Client uses this value to indicate whether the Reason String or User Properties are sent in the case of failures.

§

WillDelayInterval = 24

[Four Byte Integer, u32] The number of seconds after which a network connection is lost before the server should publish the LWT message.

§

RequestResponseInformation = 25

[Byte, u8] Request that the server return Response Information in the CONNACK

§

ResponseInformation = 26

[String] A hint for the client to create a response topic.

§

ServerReference = 28

[String] Can be used by the client to identify another server to use.

§

ReasonString = 31

[String] A reason associated with the response.

§

ReceiveMaximum = 33

[TwoByteInteger, u16] The maximum number of QoS 1 and QoS 2 publications that it is willing to process concurrently. If absent, defaults to 65,535.

§

TopicAliasMaximum = 34

[TwoByteInteger, u16] The highest value that the Client will accept as a Topic Alias sent by the Server. The Client uses this value to limit the number of Topic Aliases that it is willing to hold on this connection.

§

TopicAlias = 35

[TwoByteInteger, u16] An integer value that is used to identify the topic instead of using the Topic Name. This reduces the size of the PUBLISH packet.

§

MaximumQos = 36

[Byte] The maximum QoS supported by the server.

§

RetainAvailable = 37

[Byte] Whether retain messages are supported (1) or not (0).

§

UserProperty = 38

[StringPair] A user defined property as a key/value string pair.

§

MaximumPacketSize = 39

[FourByteInteger, u32] The maximum packet size that the client is willing to accept.

§

WildcardSubscriptionAvailable = 40

[Byte, u8] Whether the server supports wildcard subscriptions (1) or not (0).

§

SubscriptionIdentifiersAvailable = 41

[Byte, u8] Whether the server supports subscription identifiers (1) or not (0).

§

SharedSubscriptionAvailable = 42

[Byte, u8] Whether the server supports shared subscriptions (1) or not (0).

Implementations§

§

impl PropertyCode

pub fn new(code: u32) -> Option<PropertyCode>

Tries to create a PropertyCode from the integer value.

pub fn property_type(&self) -> PropertyType

Get the property type from the code identifier.

pub fn type_of(&self) -> TypeId

Gets the any::TypeId that corresponds to the property type.

Trait Implementations§

§

impl Clone for PropertyCode

§

fn clone(&self) -> PropertyCode

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

§

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

Formats the value using the given formatter. Read more
§

impl Hash for PropertyCode

§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Ord for PropertyCode

§

fn cmp(&self, other: &PropertyCode) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
§

impl PartialEq for PropertyCode

§

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

§

fn partial_cmp(&self, other: &PropertyCode) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl TryFrom<u32> for PropertyCode

§

fn try_from(code: u32) -> Result<PropertyCode, Error>

Try to convert from an integer property type to and enumeration value.

§

type Error = Error

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

impl Copy for PropertyCode

§

impl Eq for PropertyCode

§

impl StructuralPartialEq for PropertyCode

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> 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.

§

impl<T> Instrument for T

§

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

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

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> 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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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