pub enum ProtocolError {
Io {
source: Error,
backtrace: Backtrace,
},
StringEncodeFailed {
source: McStringError,
},
PacketTooLong {
backtrace: Backtrace,
},
ConnectionClosed {
backtrace: Backtrace,
},
ParseFailed {
source: FrameError,
},
SrvResolveError {
source: ResolveError,
backtrace: Backtrace,
},
FrameOutOfOrder {
backtrace: Backtrace,
expected: &'static str,
got: Frame,
},
JsonParse {
source: Error,
backtrace: Backtrace,
},
DNSLookupFailed {
address: String,
backtrace: Backtrace,
},
}Variants§
Io
I/O error.
StringEncodeFailed
Failed to encode string as bytes.
Fields
§
source: McStringErrorPacketTooLong
Failed to send a packet because it was longer than the maximum i32.
ConnectionClosed
Connection closed unexpectedly.
ParseFailed
Failed to parse a packet.
Fields
§
source: FrameErrorSrvResolveError
Failed to resolve SRV record.
FrameOutOfOrder
Packet received out of order.
JsonParse
Failed to parse JSON response.
DNSLookupFailed
DNS lookup failed.
Trait Implementations§
Source§impl Debug for ProtocolError
impl Debug for ProtocolError
Source§impl Display for ProtocolError
impl Display for ProtocolError
Source§impl Error for ProtocolError
impl Error for ProtocolError
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§impl ErrorCompat for ProtocolError
impl ErrorCompat for ProtocolError
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Returns an iterator for traversing the chain of errors,
starting with the current error
and continuing with recursive calls to
Error::source. Read moreSource§impl From<Error> for ProtocolError
impl From<Error> for ProtocolError
Source§impl From<Error> for ProtocolError
impl From<Error> for ProtocolError
Source§impl From<FrameError> for ProtocolError
impl From<FrameError> for ProtocolError
Source§fn from(error: FrameError) -> Self
fn from(error: FrameError) -> Self
Converts to this type from the input type.
Source§impl From<McStringError> for ProtocolError
impl From<McStringError> for ProtocolError
Source§fn from(error: McStringError) -> Self
fn from(error: McStringError) -> Self
Converts to this type from the input type.
Source§impl From<ProtocolError> for PingError
impl From<ProtocolError> for PingError
Source§fn from(error: ProtocolError) -> Self
fn from(error: ProtocolError) -> Self
Converts to this type from the input type.
Source§impl From<ResolveError> for ProtocolError
impl From<ResolveError> for ProtocolError
Source§fn from(error: ResolveError) -> Self
fn from(error: ResolveError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ProtocolError
impl !RefUnwindSafe for ProtocolError
impl Send for ProtocolError
impl Sync for ProtocolError
impl Unpin for ProtocolError
impl !UnwindSafe for ProtocolError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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