#[non_exhaustive]pub enum DeserializeError {
InvalidStatus(u8),
InvalidPacketType(u8),
InvalidHeaderFlags(u8),
InvalidBodyFlags(u8),
InvalidVersion(u8),
InvalidArgument(InvalidArgument),
PacketTypeMismatch {
expected: PacketType,
actual: PacketType,
},
BadText,
IncorrectUnencryptedFlag,
WrongBodyBufferSize {
expected: usize,
buffer_size: usize,
},
UnexpectedEnd,
}Expand description
An error that occurred during deserialization of a full/partial packet.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidStatus(u8)
Invalid binary status representation in response.
InvalidPacketType(u8)
Invalid packet type number on the wire.
InvalidHeaderFlags(u8)
Invalid header flag byte.
InvalidBodyFlags(u8)
Invalid body flag byte.
InvalidVersion(u8)
Invalid version number.
InvalidArgument(InvalidArgument)
Invalid arguments when deserializing
PacketTypeMismatch
Mismatch between expected/received packet types.
Fields
§
expected: PacketTypeThe expected packet type.
§
actual: PacketTypeThe actual packet type that was parsed.
BadText
Text field was not printable ASCII when it should have been.
IncorrectUnencryptedFlag
Unencrypted flag was not the expected value.
WrongBodyBufferSize
Buffer containing raw body had incorrect length with respect to length fields in the body.
Fields
UnexpectedEnd
Object representation was cut off in some way.
Trait Implementations§
Source§impl Debug for DeserializeError
impl Debug for DeserializeError
Source§impl Display for DeserializeError
impl Display for DeserializeError
Source§impl Error for DeserializeError
Available on crate feature std only.
impl Error for DeserializeError
Available on crate feature
std only.1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns 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<InvalidArgument> for DeserializeError
impl From<InvalidArgument> for DeserializeError
Source§fn from(value: InvalidArgument) -> Self
fn from(value: InvalidArgument) -> Self
Converts to this type from the input type.
Source§impl PartialEq for DeserializeError
impl PartialEq for DeserializeError
impl Eq for DeserializeError
impl StructuralPartialEq for DeserializeError
Auto Trait Implementations§
impl Freeze for DeserializeError
impl RefUnwindSafe for DeserializeError
impl Send for DeserializeError
impl Sync for DeserializeError
impl Unpin for DeserializeError
impl UnwindSafe for DeserializeError
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