Enum DecodeError
#[non_exhaustive]pub enum DecodeError {
Show 15 variants
InsufficientData,
MalformedVbi,
InvalidUtf8,
StringContainsNull,
InvalidValue,
InvalidPropertyId,
DuplicateProperty,
InvalidFlags,
InvalidProtocol,
LengthMismatch,
TrailingBytes,
InvalidPacketId,
InvalidSubscriptionOptions,
InvalidTopic(TopicError),
TooLong,
}Expand description
Errors that can occur during decoding.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InsufficientData
Not enough bytes in the buffer.
MalformedVbi
A Variable Byte Integer exceeds 4 bytes or is not minimally encoded.
InvalidUtf8
String bytes are not valid UTF-8.
StringContainsNull
A UTF-8 string contains the null character U+0000.
InvalidValue
A reserved or unknown field value was encountered.
InvalidPropertyId
An unknown property identifier was encountered.
DuplicateProperty
A property that may appear at most once was included more than once (Protocol Error, §2.2.2.2).
InvalidFlags
Fixed header flags are wrong for the packet type.
InvalidProtocol
The protocol name or version in CONNECT is wrong.
LengthMismatch
Remaining length does not match actual content.
TrailingBytes
A packet’s defined fields were decoded but unread bytes remain in its body.
InvalidPacketId
A packet identifier was zero, which is invalid.
InvalidSubscriptionOptions
A subscription options byte set reserved bits.
InvalidTopic(TopicError)
A topic name or topic filter failed validation.
TooLong
A variable-length value exceeds the maximum allowed length.
Trait Implementations§
§impl Clone for DecodeError
impl Clone for DecodeError
§fn clone(&self) -> DecodeError
fn clone(&self) -> DecodeError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DecodeError
§impl Debug for DecodeError
impl Debug for DecodeError
§impl Display for DecodeError
impl Display for DecodeError
impl Eq for DecodeError
§impl Error for DecodeError
impl Error for DecodeError
§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()