#[non_exhaustive]pub enum ProtocolError {
Primitive(PrimitiveError),
Bytes(BytesError),
String(StringError),
Uuid(UuidError),
Tagged(TaggedFieldError),
Crc(CrcMismatch),
Frame(FrameError),
Record(RecordError),
Compression(CompressionError),
Version(UnsupportedVersion),
FieldVersion(UnsupportedFieldVersion),
}Expand description
Crate-wide error facade. Every module error converts in via #[from].
§Why a facade and not a single big enum?
Module errors stay narrow — callers that only deal with primitives won’t be
forced to match a RecordError variant they can’t produce. The facade
only widens at the boundary where errors need to flow uniformly (e.g. the
generated message decoders).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Primitive(PrimitiveError)
Primitive int / varint / array-length read failed.
Bytes(BytesError)
Length-prefixed raw bytes read/write failed.
String(StringError)
KafkaString read/write failed (length, UTF-8, null marker).
Uuid(UuidError)
KafkaUuid parse failed.
Tagged(TaggedFieldError)
Tagged-fields section is malformed (out-of-order tag, bad size).
Crc(CrcMismatch)
CRC32C check failed on a record batch.
Frame(FrameError)
TCP frame length prefix is invalid or oversized.
Record(RecordError)
Record batch decode failed (CRC, magic, length, record count).
Compression(CompressionError)
Compression codec dispatch / encode / decode failed.
Version(UnsupportedVersion)
API key / version negotiation failed.
FieldVersion(UnsupportedFieldVersion)
A generated message field was set for a version where it is absent.
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 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()