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§
Source§impl Clone for DecodeError
impl Clone for DecodeError
Source§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
Source§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
impl Eq for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
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
use the Display impl or to_string()
Source§impl From<DecodeError> for Error
impl From<DecodeError> for Error
Source§fn from(e: DecodeError) -> Error
fn from(e: DecodeError) -> Error
Source§impl PartialEq for DecodeError
impl PartialEq 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 UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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