pub enum PacketParseError {
Show 19 variants
InvalidConnectReturnCode(u8),
InvalidProtocol,
InvalidProtocolLevel(u8),
IncorrectPacketFormat,
InvalidPacketType(u8),
InvalidPropertyType(u8),
InvalidQoS(u8),
InvalidSubscribeReasonCode(u8),
PacketIdZero,
PayloadSizeIncorrect,
PayloadTooLong,
PayloadSizeLimitExceeded(usize),
PayloadRequired,
TopicNotUtf8,
BoundaryCrossed(usize),
MalformedPacket,
EmptySubscription,
InsufficientBytes(usize),
MalformedRemainingLength,
}
Expand description
Error during serialization and deserialization
Variants§
InvalidConnectReturnCode(u8)
InvalidProtocol
InvalidProtocolLevel(u8)
IncorrectPacketFormat
InvalidPacketType(u8)
InvalidPropertyType(u8)
InvalidQoS(u8)
InvalidSubscribeReasonCode(u8)
PacketIdZero
PayloadSizeIncorrect
PayloadTooLong
PayloadSizeLimitExceeded(usize)
PayloadRequired
TopicNotUtf8
BoundaryCrossed(usize)
包中相关长度值与剩余数据长度不匹配——
MalformedPacket
无法用约定规则解析出包
EmptySubscription
InsufficientBytes(usize)
剩余长度使用了一种可变长度的结构来编码, 这种结构使用单一字节表示0-127的值。 无法用约定的规则解析剩余长度——断开
MalformedRemainingLength
包剩余长度大于剩余长度——需要等待其他数据
Trait Implementations§
source§impl Clone for PacketParseError
impl Clone for PacketParseError
source§fn clone(&self) -> PacketParseError
fn clone(&self) -> PacketParseError
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PacketParseError
impl Debug for PacketParseError
source§impl Display for PacketParseError
impl Display for PacketParseError
source§impl Error for PacketParseError
impl Error for PacketParseError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<FixedHeaderError> for PacketParseError
impl From<FixedHeaderError> for PacketParseError
source§fn from(value: FixedHeaderError) -> Self
fn from(value: FixedHeaderError) -> Self
Converts to this type from the input type.
source§impl PartialEq<PacketParseError> for PacketParseError
impl PartialEq<PacketParseError> for PacketParseError
source§fn eq(&self, other: &PacketParseError) -> bool
fn eq(&self, other: &PacketParseError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for PacketParseError
impl Eq for PacketParseError
impl StructuralEq for PacketParseError
impl StructuralPartialEq for PacketParseError
Auto Trait Implementations§
impl RefUnwindSafe for PacketParseError
impl Send for PacketParseError
impl Sync for PacketParseError
impl Unpin for PacketParseError
impl UnwindSafe for PacketParseError
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more