DecodeError

Enum DecodeError 

Source
pub enum DecodeError {
Show 20 variants InvalidClientId, InvalidPacketType, InvalidProtocolLevel, InvalidProtocolName, InvalidConnectFlags, InvalidQoS, InvalidPacketFlags, InvalidPacketId, InvalidVarInt, InvalidBoolData, InvalidRemainingLength, InvalidString(StringError), InvalidTopic(TopicError), InvalidPropertyType, InvalidPropertyValue, InvalidReasonCode, OutOfRangeError, TooManyData, EmptyTopicFilter, OtherErrors,
}

Variants§

§

InvalidClientId

ClientId is empty or its length exceeds 23. Or contains invalid characters.

§

InvalidPacketType

§

InvalidProtocolLevel

Protocol level is not in 3.1, 3.1.1 or 5.0.

§

InvalidProtocolName

Protocol name must be “MQTT”.

§

InvalidConnectFlags

Resrved bit in connect packet is not zero.

§

InvalidQoS

QoS not 0, 1, 2

§

InvalidPacketFlags

Invalid flag value in fixed header.

Does not contain InvalidQoS.

§

InvalidPacketId

PacketId should be present but not set. Or PacketId is none where it is required.

§

InvalidVarInt

Failed to parse variable byte integer.

§

InvalidBoolData

§

InvalidRemainingLength

Length of buffer - offset < remaining length.

§

InvalidString(StringError)

Invalid UTF-8 string.

§

InvalidTopic(TopicError)

Violate topic filter rules. Topic name might contain wildcard characters.

§

InvalidPropertyType

Unknown property type bit.

§

InvalidPropertyValue

Failed to parse property value.

§

InvalidReasonCode

Used in v5 protocol.

§

OutOfRangeError

Byte array index ouf of range.

§

TooManyData

Length of data exceeds its limitation

§

EmptyTopicFilter

No topic is speicified in Subscribe packet.

§

OtherErrors

General errors

Trait Implementations§

Source§

impl Debug for DecodeError

Source§

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

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

impl From<ByteArrayError> for DecodeError

Source§

fn from(err: ByteArrayError) -> Self

Converts to this type from the input type.
Source§

impl From<StringError> for DecodeError

Source§

fn from(err: StringError) -> Self

Converts to this type from the input type.
Source§

impl From<TopicError> for DecodeError

Source§

fn from(err: TopicError) -> Self

Converts to this type from the input type.
Source§

impl From<VarIntError> for DecodeError

Source§

fn from(_err: VarIntError) -> Self

Converts to this type from the input type.

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

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V