ReasonCode

Enum ReasonCode 

#[repr(u8)]
pub enum ReasonCode {
Show 43 variants Success = 0, GrantedQoS1 = 1, GrantedQoS2 = 2, DisconnectWithWillMessage = 4, NoMatchingSubscribers = 16, NoSubscriptionExisted = 17, ContinueAuthentication = 24, ReAuthenticate = 25, UnspecifiedError = 128, MalformedPacket = 129, ProtocolError = 130, ImplementationSpecificError = 131, UnsupportedProtocolVersion = 132, ClientIdentifierNotValid = 133, BadUserNameOrPassword = 134, NotAuthorized = 135, ServerUnavailable = 136, ServerBusy = 137, Banned = 138, ServerShuttingDown = 139, BadAuthenticationMethod = 140, KeepAliveTimeout = 141, SessionTakenOver = 142, TopicFilterInvalid = 143, TopicNameInvalid = 144, PacketIdentifierInUse = 145, PacketIdentifierNotFound = 146, ReceiveMaximumExceeded = 147, TopicAliasInvalid = 148, PacketTooLarge = 149, MessageRateTooHigh = 150, QuotaExceeded = 151, AdministrativeAction = 152, PayloadFormatInvalid = 153, RetainNotSupported = 154, QoSNotSupported = 155, UseAnotherServer = 156, ServerMoved = 157, SharedSubscriptionsNotSupported = 158, ConnectionRateExceeded = 159, MaximumConnectTime = 160, SubscriptionIdentifiersNotSupported = 161, WildcardSubscriptionsNotSupported = 162,
}
Expand description

All MQTT v5 reason codes.

Variants§

§

Success = 0

Operation completed successfully (0x00).

§

GrantedQoS1 = 1

Granted maximum QoS 1 (0x01).

§

GrantedQoS2 = 2

Granted maximum QoS 2 (0x02).

§

DisconnectWithWillMessage = 4

Disconnect with will message (0x04).

§

NoMatchingSubscribers = 16

No matching subscribers (0x10).

§

NoSubscriptionExisted = 17

No subscription existed (0x11).

§

ContinueAuthentication = 24

Continue authentication (0x18).

§

ReAuthenticate = 25

Re-authenticate (0x19).

§

UnspecifiedError = 128

Unspecified error (0x80).

§

MalformedPacket = 129

Malformed packet (0x81).

§

ProtocolError = 130

Protocol error (0x82).

§

ImplementationSpecificError = 131

Implementation specific error (0x83).

§

UnsupportedProtocolVersion = 132

Unsupported protocol version (0x84).

§

ClientIdentifierNotValid = 133

Client identifier not valid (0x85).

§

BadUserNameOrPassword = 134

Bad user name or password (0x86).

§

NotAuthorized = 135

Not authorized (0x87).

§

ServerUnavailable = 136

Server unavailable (0x88).

§

ServerBusy = 137

Server busy (0x89).

§

Banned = 138

Banned (0x8A).

§

ServerShuttingDown = 139

Server shutting down (0x8B).

§

BadAuthenticationMethod = 140

Bad authentication method (0x8C).

§

KeepAliveTimeout = 141

Keep alive timeout (0x8D).

§

SessionTakenOver = 142

Session taken over (0x8E).

§

TopicFilterInvalid = 143

Topic filter invalid (0x8F).

§

TopicNameInvalid = 144

Topic name invalid (0x90).

§

PacketIdentifierInUse = 145

Packet identifier in use (0x91).

§

PacketIdentifierNotFound = 146

Packet identifier not found (0x92).

§

ReceiveMaximumExceeded = 147

Receive maximum exceeded (0x93).

§

TopicAliasInvalid = 148

Topic alias invalid (0x94).

§

PacketTooLarge = 149

Packet too large (0x95).

§

MessageRateTooHigh = 150

Message rate too high (0x96).

§

QuotaExceeded = 151

Quota exceeded (0x97).

§

AdministrativeAction = 152

Administrative action (0x98).

§

PayloadFormatInvalid = 153

Payload format invalid (0x99).

§

RetainNotSupported = 154

Retain not supported (0x9A).

§

QoSNotSupported = 155

QoS not supported (0x9B).

§

UseAnotherServer = 156

Use another server (0x9C).

§

ServerMoved = 157

Server moved (0x9D).

§

SharedSubscriptionsNotSupported = 158

Shared subscriptions not supported (0x9E).

§

ConnectionRateExceeded = 159

Connection rate exceeded (0x9F).

§

MaximumConnectTime = 160

Maximum connect time (0xA0).

§

SubscriptionIdentifiersNotSupported = 161

Subscription identifiers not supported (0xA1).

§

WildcardSubscriptionsNotSupported = 162

Wildcard subscriptions not supported (0xA2).

Implementations§

§

impl ReasonCode

pub const fn from_u8(v: u8) -> Option<Self>

Converts a raw byte to a reason code, returning None if unknown.

pub const fn is_error(self) -> bool

Returns whether this reason code indicates an error (>= 0x80).

Trait Implementations§

§

impl Clone for ReasonCode

§

fn clone(&self) -> ReasonCode

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 ReasonCode

§

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

Formats the value using the given formatter. Read more
§

impl Hash for ReasonCode

§

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

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 PartialEq for ReasonCode

§

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

§

impl Eq for ReasonCode

§

impl StructuralPartialEq for ReasonCode

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.

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.