#[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
A Reason Code is a variable byte integer encoded value that indicates the result of an operation.
The CONNACK, PUBACK, PUBREC, PUBREL, PUBCOMP, DISCONNECT and AUTH Control Packets have a single Reason Code as part of the Variable Header. The SUBACK and UNSUBACK packets contain a list of one or more Reason Codes in the Payload.
Variants§
Success = 0
§aka GrantedQoS0, NormalDisconnection
CONNACK, PUBACK, PUBREC, PUBREL, PUBCOMP, SUBACK, UNSUBACK, AUTH, DISCONNECT
GrantedQoS1 = 1
SUBACK
GrantedQoS2 = 2
SUBACK
DisconnectWithWillMessage = 4
DISCONNECT
NoMatchingSubscribers = 16
PUBACK, PUBREC
NoSubscriptionExisted = 17
UNSUBACK
ContinueAuthentication = 24
AUTH
ReAuthenticate = 25
AUTH
UnspecifiedError = 128
CONNACK, PUBACK, PUBREC, SUBACK, UNSUBACK, DISCONNECT
MalformedPacket = 129
CONNACK, DISCONNECT
ProtocolError = 130
CONNACK, DISCONNECT
ImplementationSpecificError = 131
CONNACK, PUBACK, PUBREC, SUBACK, UNSUBACK, DISCONNECT
UnsupportedProtocolVersion = 132
CONNACK
ClientIdentifierNotValid = 133
CONNACK
BadUserNameOrPassword = 134
CONNACK
NotAuthorized = 135
CONNACK, PUBACK, PUBREC, SUBACK, UNSUBACK, DISCONNECT
CONNACK
ServerBusy = 137
CONNACK, DISCONNECT
Banned = 138
CONNACK
ServerShuttingDown = 139
DISCONNECT
BadAuthenticationMethod = 140
CONNACK, DISCONNECT
KeepAliveTimeout = 141
DISCONNECT
SessionTakenOver = 142
DISCONNECT
TopicFilterInvalid = 143
SUBACK, UNSUBACK, DISCONNECT
TopicNameInvalid = 144
CONNACK, PUBACK, PUBREC, DISCONNECT
PacketIdentifierInUse = 145
PUBACK, PUBREC, SUBACK, UNSUBACK
PacketIdentifierNotFound = 146
PUBREL, PUBCOMP
ReceiveMaximumExceeded = 147
DISCONNECT
TopicAliasInvalid = 148
DISCONNECT
PacketTooLarge = 149
CONNACK, DISCONNECT
MessageRateTooHigh = 150
DISCONNECT
QuotaExceeded = 151
CONNACK, PUBACK, PUBREC, SUBACK, DISCONNECT
AdministrativeAction = 152
DISCONNECT
PayloadFormatInvalid = 153
CONNACK, PUBACK, PUBREC, DISCONNECT
RetainNotSupported = 154
CONNACK, DISCONNECT
QoSNotSupported = 155
CONNACK, DISCONNECT
UseAnotherServer = 156
CONNACK, DISCONNECT
ServerMoved = 157
CONNACK, DISCONNECT
SUBACK, DISCONNECT
ConnectionRateExceeded = 159
CONNACK, DISCONNECT
MaximumConnectTime = 160
DISCONNECT
SubscriptionIdentifiersNotSupported = 161
SUBACK, DISCONNECT
WildcardSubscriptionsNotSupported = 162
SUBACK, DISCONNECT
Implementations§
Source§impl ReasonCode
impl ReasonCode
Sourcepub const fn is_success(&self) -> bool
pub const fn is_success(&self) -> bool
Returns whether the reason code is successful. This is the case if the reason code’s numeric value is less than 0x80.
Sourcepub const fn is_erroneous(&self) -> bool
pub const fn is_erroneous(&self) -> bool
Returns whether the reason code indicates an error. This is the case if the reason code’s numeric value is greater than or equal to 0x80.
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 more