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§

Source§

impl ReasonCode

Source

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

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

Source

pub const fn is_error(self) -> bool

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

Source

pub const fn confirms_subscription(self) -> bool

Returns whether a SUBACK reason code grants the subscription (§3.9.3).

A granted code is any non-error code (< 0x80): Success, GrantedQoS1, or GrantedQoS2.

Source

pub const fn confirms_unsubscription(self) -> bool

Returns whether an UNSUBACK reason code confirms the removal (§3.11.3).

Only Success and NoSubscriptionExisted remove the stored subscription; any other code leaves it in place.

Source

pub const fn slice_from_bytes( bytes: &[u8], ) -> Result<&[ReasonCode], DecodeError>

Validates wire bytes as a slice of reason codes.

§Errors

Returns DecodeError::InvalidValue if any byte is not a known reason code.

Source

pub const fn slice_as_bytes(codes: &[ReasonCode]) -> &[u8]

Reinterprets a slice of reason codes as its wire bytes.

Trait Implementations§

Source§

impl Clone for ReasonCode

Source§

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

impl Debug for ReasonCode

Source§

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

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

impl Hash for ReasonCode

Source§

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

impl PartialEq for ReasonCode

Source§

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

impl Copy for ReasonCode

Source§

impl Eq for ReasonCode

Source§

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.

§

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,