pub enum ReasonCode {
Show 45 variants
Success,
NormalDisconnection,
GrantedQos0,
GrantedQos1,
GrantedQos2,
DisconnectWithWillMessage,
NoMatchingSubscribers,
NoSubscriptionExisted,
ContinueAuthentication,
ReAuthenticate,
UnspecifiedError,
MalformedPacket,
ProtocolError,
ImplementationSpecificError,
UnsupportedProtocolVersion,
ClientIdentifierNotValid,
BadUserNameOrPassword,
NotAuthorized,
ServerUnavailable,
ServerBusy,
Banned,
ServerShuttingDown,
BadAuthenticationMethod,
KeepAliveTimeout,
SessionTakenOver,
TopicFilterInvalid,
TopicNameInvalid,
PacketIdentifierInUse,
PacketIdentifierNotFound,
ReceiveMaximumExceeded,
TopicAliasInvalid,
PacketTooLarge,
MessageRateTooHigh,
QuotaExceeded,
AdministrativeAction,
PayloadFormatInvalid,
RetainNotSupported,
QosNotSupported,
UseAnotherServer,
ServerMoved,
SharedSubscriptionsNotSupported,
ConnectionRateExceeded,
MaximumConnectTime,
SubscriptionIdentifiersNotSupported,
WildcardSubscriptionsNotSupported,
}Expand description
Represents all possible reason codes in MQTT v5 protocol.
Reason codes are used in various MQTT packets to indicate the result of operations or the reason for disconnections. Each variant corresponds to a specific numeric code as defined in the MQTT v5 specification.
Variants§
Success
Success (0x00)
NormalDisconnection
Normal disconnection (0x00)
GrantedQos0
Granted QoS 0 (0x00)
GrantedQos1
Granted QoS 1 (0x01)
GrantedQos2
Granted QoS 2 (0x02)
DisconnectWithWillMessage
Disconnect with Will Message (0x04)
NoMatchingSubscribers
No matching subscribers (0x10)
NoSubscriptionExisted
No subscription existed (0x11)
ContinueAuthentication
Continue authentication (0x18)
ReAuthenticate
Re-authenticate (0x19)
UnspecifiedError
Unspecified error (0x80)
MalformedPacket
Malformed Packet (0x81)
ProtocolError
Protocol Error (0x82)
ImplementationSpecificError
Implementation specific error (0x83)
UnsupportedProtocolVersion
Unsupported Protocol Version (0x84)
ClientIdentifierNotValid
Client Identifier not valid (0x85)
BadUserNameOrPassword
Bad User Name or Password (0x86)
NotAuthorized
Not authorized (0x87)
Server unavailable (0x88)
ServerBusy
Server busy (0x89)
Banned
Banned (0x8A)
ServerShuttingDown
Server shutting down (0x8B)
BadAuthenticationMethod
Bad authentication method (0x8C)
KeepAliveTimeout
Keep Alive timeout (0x8D)
SessionTakenOver
Session taken over (0x8E)
TopicFilterInvalid
Topic Filter invalid (0x8F)
TopicNameInvalid
Topic Name invalid (0x90)
PacketIdentifierInUse
Packet Identifier in use (0x91)
PacketIdentifierNotFound
Packet Identifier not found (0x92)
ReceiveMaximumExceeded
Receive Maximum exceeded (0x93)
TopicAliasInvalid
Topic Alias invalid (0x94)
PacketTooLarge
Packet too large (0x95)
MessageRateTooHigh
Message rate too high (0x96)
QuotaExceeded
Quota exceeded (0x97)
AdministrativeAction
Administrative action (0x98)
PayloadFormatInvalid
Payload format invalid (0x99)
RetainNotSupported
Retain not supported (0x9A)
QosNotSupported
QoS not supported (0x9B)
UseAnotherServer
Use another server (0x9C)
ServerMoved
Server moved (0x9D)
Shared Subscriptions not supported (0x9E)
ConnectionRateExceeded
Connection rate exceeded (0x9F)
MaximumConnectTime
Maximum connect time (0xA0)
SubscriptionIdentifiersNotSupported
Subscription Identifiers not supported (0xA1)
WildcardSubscriptionsNotSupported
Wildcard Subscriptions not supported (0xA2)
Trait Implementations§
Source§impl Clone for ReasonCode
impl Clone for ReasonCode
Source§fn clone(&self) -> ReasonCode
fn clone(&self) -> ReasonCode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReasonCode
impl Debug for ReasonCode
Source§impl Display for ReasonCode
impl Display for ReasonCode
Source§impl From<ReasonCode> for u8
impl From<ReasonCode> for u8
Source§fn from(value: ReasonCode) -> Self
fn from(value: ReasonCode) -> Self
Converts a ReasonCode to its numeric representation.
§Example
use mqute_codec::protocol::v5::ReasonCode;
let code: u8 = ReasonCode::GrantedQos1.into();
assert_eq!(code, 1);