pub enum PacketError {
Show 14 variants
DecodeID,
TooLong(usize),
OutOfBounds,
MalformedLength(String),
MalformedValue(String),
DecompressionFailed(String),
CompressionFailed(String),
NotCompressed,
DecryptionFailed(String),
EncryptionFailed(String),
ConnectionClosed,
SendError(String),
Other(String),
InvalidProtocol(String),
}Expand description
An error that can occur when handling packets.
Variants§
DecodeID
Failed to decode the packet ID.
TooLong(usize)
The packet length exceeds the maximum length.
OutOfBounds
The packet length is out of bounds.
MalformedLength(String)
The packet length VarInt is malformed.
MalformedValue(String)
A value in the packet is malformed.
DecompressionFailed(String)
Failed to decompress the packet.
CompressionFailed(String)
Failed to compress the packet.
NotCompressed
The packet is uncompressed but greater than the threshold.
DecryptionFailed(String)
Failed to decrypt the packet.
EncryptionFailed(String)
Failed to encrypt the packet.
ConnectionClosed
The connection has closed.
SendError(String)
An error occurred when sending a packet.
Other(String)
An other error occurred.
InvalidProtocol(String)
The protocol is invalid.
Trait Implementations§
Source§impl Debug for PacketError
impl Debug for PacketError
Source§impl Display for PacketError
impl Display for PacketError
Source§impl Error for PacketError
impl Error for PacketError
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()
Auto Trait Implementations§
impl Freeze for PacketError
impl RefUnwindSafe for PacketError
impl Send for PacketError
impl Sync for PacketError
impl Unpin for PacketError
impl UnsafeUnpin for PacketError
impl UnwindSafe for PacketError
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
§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> ⓘ
Converts
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> ⓘ
Converts
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 moreWraps this value in an
Arc<SyncMutex<>>