Enum DecodeError
#[non_exhaustive]pub enum DecodeError {
Show 14 variants
InsufficientData,
MalformedVbi,
InvalidUtf8,
StringContainsNull,
InvalidValue,
InvalidPropertyId,
DuplicateProperty,
InvalidFlags,
InvalidProtocol,
LengthMismatch,
TrailingBytes,
InvalidPacketId,
InvalidSubscriptionOptions,
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
Variable Byte Integer uses more than 4 bytes.
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.
TooLong
A dynamically sized value exceeds the maximum allowed length.
Trait Implementations§
Source§impl Clone for DecodeError
impl Clone for DecodeError
Source§fn clone(&self) -> DecodeError
fn clone(&self) -> DecodeError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
1.30.0 · Source§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
§impl From<DecodeError> for Error
impl From<DecodeError> for Error
§fn from(e: DecodeError) -> Self
fn from(e: DecodeError) -> Self
Source§impl PartialEq for DecodeError
impl PartialEq for DecodeError
impl Copy for DecodeError
impl Eq for DecodeError
impl StructuralPartialEq for DecodeError
Auto Trait Implementations§
impl Freeze for DecodeError
impl RefUnwindSafe for DecodeError
impl Send for DecodeError
impl Sync for DecodeError
impl Unpin for DecodeError
impl UnwindSafe for DecodeError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more