pub enum Error {
Show 27 variants
InvalidConnectReturnCode(u8),
InvalidPacketType(u8),
InvalidProtocolLevel(u8),
InvalidProtocolName(String),
InvalidProperty(u8),
InvalidQos(u8),
InvalidReasonCode(u8),
InvalidRetainHandling(u8),
InvalidTopicName(String),
InvalidTopicFilter(String),
InvalidUtf8,
Io(Error),
MalformedVariableByteInteger,
MalformedPacket,
NoCodes,
NotEnoughBytes(usize),
NoTopic,
OutgoingPayloadSizeLimitExceeded(usize),
OutOfBounds,
PayloadTooLarge,
PayloadRequired,
PayloadSizeLimitExceeded(usize),
ProtocolError,
ProtocolMismatch,
ProtocolNotSupported,
PropertyMismatch,
StringTooLong,
}Expand description
Represents errors that can occur when working with the MQTT protocol.
Each variant includes a descriptive error message and, where applicable,
additional context (e.g., invalid values or sizes). This enum implements
the standard Error trait and can be easily converted from other error types.
Variants§
InvalidConnectReturnCode(u8)
Indicates an invalid connect return code received from the broker.
InvalidPacketType(u8)
Indicates an invalid packet type encountered during parsing.
InvalidProtocolLevel(u8)
Indicates an unsupported or invalid protocol level.
InvalidProtocolName(String)
Indicates an invalid or unrecognized protocol name.
InvalidProperty(u8)
Indicates an invalid property identifier in MQTT properties.
InvalidQos(u8)
Indicates an invalid Quality of Service level.
InvalidReasonCode(u8)
Indicates an invalid reason code in MQTT response packets.
InvalidRetainHandling(u8)
Indicates invalid retain handling configuration.
InvalidTopicName(String)
Indicates a malformed or invalid topic name.
InvalidTopicFilter(String)
Indicates a malformed or invalid topic filter.
InvalidUtf8
Indicates invalid UTF-8 data in string fields.
Io(Error)
Wraps an I/O error that occurred during network operations.
MalformedVariableByteInteger
Indicates a malformed variable byte integer encoding.
MalformedPacket
Indicates a general malformed packet structure.
NoCodes
Indicates that the payload must contain at least one return code but was empty.
NotEnoughBytes(usize)
Indicates insufficient bytes to complete packet framing.
NoTopic
Indicates that the payload must contain at least one topic filter but was empty.
OutgoingPayloadSizeLimitExceeded(usize)
Indicates that the outgoing payload exceeds the configured size limit.
OutOfBounds
Indicates an out-of-bounds access during packet parsing.
PayloadTooLarge
Indicates that the payload exceeds the maximum allowed size.
PayloadRequired
Indicates that a payload is required for this packet type but was missing.
PayloadSizeLimitExceeded(usize)
Indicates that the payload exceeds the general size limit.
ProtocolError
Indicates a general protocol violation error.
ProtocolMismatch
Indicates a mismatch between expected and actual protocol versions.
ProtocolNotSupported
Indicates that the requested protocol is not supported.
PropertyMismatch
Indicates a mismatch between expected and actual properties.
StringTooLong
Indicates that a string exceeds the maximum allowed length.