Enum minimq::ReasonCode

source ·
#[repr(u8)]
pub enum ReasonCode {
Show 42 variants Success = 0, GrantedQos1 = 1, GrantedQos2 = 2, DisconnectWithWill = 4, NoMatchingSubscribers = 16, NoSubscriptionExisted = 17, ContinueAuthentication = 24, Reuathenticate = 25, UnspecifiedError = 128, MalformedPacket = 129, ProtocolError = 130, ImplementationError = 131, UnsupportedProtocol = 132, ClientIdentifierInvalid = 133, BadUsernameOrPassword = 134, NotAuthorized = 135, ServerUnavailable = 136, ServerBusy = 137, BadAuthMethod = 140, KeepAliveTimeout = 141, SessionTakenOver = 142, TopicFilterInvalid = 143, TopicNameInvalid = 144, PacketIdInUse = 145, PacketIdNotFound = 146, ReceiveMaxExceeded = 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, Unknown = 255,
}
Expand description

MQTTv5-defined codes that may be returned in response to control packets.

Variants§

§

Success = 0

§

GrantedQos1 = 1

§

GrantedQos2 = 2

§

DisconnectWithWill = 4

§

NoMatchingSubscribers = 16

§

NoSubscriptionExisted = 17

§

ContinueAuthentication = 24

§

Reuathenticate = 25

§

UnspecifiedError = 128

§

MalformedPacket = 129

§

ProtocolError = 130

§

ImplementationError = 131

§

UnsupportedProtocol = 132

§

ClientIdentifierInvalid = 133

§

BadUsernameOrPassword = 134

§

NotAuthorized = 135

§

ServerUnavailable = 136

§

ServerBusy = 137

§

BadAuthMethod = 140

§

KeepAliveTimeout = 141

§

SessionTakenOver = 142

§

TopicFilterInvalid = 143

§

TopicNameInvalid = 144

§

PacketIdInUse = 145

§

PacketIdNotFound = 146

§

ReceiveMaxExceeded = 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

§

Unknown = 255

The reason code is not one of the documented MQTT reason codes.

Implementations§

source§

impl ReasonCode

source

pub fn as_result(&self) -> Result<(), ProtocolError>

source

pub fn success(&self) -> bool

source

pub fn failed(&self) -> bool

Trait Implementations§

source§

impl Clone for ReasonCode

source§

fn clone(&self) -> ReasonCode

Returns a copy 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

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

impl<'de> Deserialize<'de> for ReasonCode

source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<&ReasonCode> for u8

source§

fn from(code: &ReasonCode) -> u8

Converts to this type from the input type.
source§

impl From<ReasonCode> for ProtocolError

source§

fn from(code: ReasonCode) -> Self

Converts to this type from the input type.
source§

impl From<ReasonCode> for Result<(), ReasonCode>

source§

fn from(code: ReasonCode) -> Result<(), ReasonCode>

Converts to this type from the input type.
source§

impl From<ReasonCode> for u8

source§

fn from(enum_value: ReasonCode) -> Self

Converts to this type from the input type.
source§

impl<T, E: Into<ReasonCode>> From<Result<T, E>> for ReasonCode

source§

fn from(result: Result<T, E>) -> ReasonCode

Converts to this type from the input type.
source§

impl From<u8> for ReasonCode

source§

fn from(number: u8) -> Self

Converts to this type from the input type.
source§

impl FromPrimitive for ReasonCode

§

type Primitive = u8

source§

fn from_primitive(number: Self::Primitive) -> Self

source§

impl PartialEq for ReasonCode

source§

fn eq(&self, other: &ReasonCode) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for ReasonCode

source§

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

This method 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

This method 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

This method 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

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

impl Serialize for ReasonCode

source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
source§

impl Copy 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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,