pub enum Error {
UnknownPacket {
id: i32,
state: &'static str,
},
Type(Error),
}Expand description
Errors that can occur during packet encoding, decoding, or registry dispatch.
This error type wraps basalt_types::Error for lower-level serialization
failures and adds protocol-specific errors like unknown packet IDs.
Higher layers (basalt-net) wrap this error in turn via #[from].
Variants§
UnknownPacket
A packet ID was not recognized for the given connection state.
This occurs when the registry receives a packet ID that doesn’t match any known packet in the current state and direction. May indicate a protocol version mismatch, a corrupted stream, or an unimplemented packet.
Fields
Type(Error)
A lower-level type encoding/decoding error.
Wraps errors from basalt-types: buffer underflow, invalid data, VarInt overflow, string length violations, UTF-8 errors, and NBT parsing failures.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()