#[non_exhaustive]pub enum KafkaError {
Connect(Box<dyn StdError + Send + Sync>),
Publish(Box<dyn StdError + Send + Sync>),
Subscribe(Box<dyn StdError + Send + Sync>),
Consume(Box<dyn StdError + Send + Sync>),
Closed {
topic: String,
},
InvalidOptions(String),
TransactionBusy {
id: String,
},
NoTransaction {
id: String,
},
SchemaRegistry(Box<dyn StdError + Send + Sync>),
SchemaRegistryTimeout {
request: String,
timeout: Duration,
},
WireFormat(Box<dyn StdError + Send + Sync>),
}Expand description
Errors returned by KafkaBroker and the types it hands out.
Underlying rdkafka errors are boxed as sources so the client
library does not leak into this crate’s public API surface.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Connect(Box<dyn StdError + Send + Sync>)
Creating a client failed or the cluster was unreachable during the connect probe.
Publish(Box<dyn StdError + Send + Sync>)
Publishing a message failed or the broker did not confirm its delivery.
Subscribe(Box<dyn StdError + Send + Sync>)
Creating a consumer or subscribing it to its topic failed.
Consume(Box<dyn StdError + Send + Sync>)
Receiving a delivery from an open consumer failed.
Closed
A handle aliasing the connection was used after the broker shut down.
The lifecycle ladder makes misuse through the owner’s handle a compile error:
ConnectedBroker::shutdown consumes the
connected broker. Publishers paired off it earlier, and subscriptions still open, keep
aliasing the closed connection, so their operations report this instead of silently
succeeding against a dead connection.
Fields
InvalidOptions(String)
The requested combination of options cannot be executed.
The message names the offending option and the remediation.
TransactionBusy
begin_transaction found a transaction already open on this publisher.
One producer runs one transaction at a time, so a second begin means two flows share
one publisher; erroring beats silently merging their messages into one transaction.
Concurrent transactional flows need distinct publishers - one per partition via
TransactionalPartitions, or distinct explicit ids.
NoTransaction
commit or abort was called with no transaction open on this publisher.
SchemaRegistry(Box<dyn StdError + Send + Sync>)
A Schema Registry request failed: unreachable registry, rejected credentials, an unknown schema id or subject, or a schema the registry refused.
SchemaRegistryTimeout
A Schema Registry request did not answer within the client’s request timeout.
A registry that accepts the connection and then goes silent is the case this separates
from an outright failure: both edges resolve schemas on the async delivery path, so
without a deadline one silent registry holds a delivery for as long as it stays silent.
SchemaRegistry::request_timeout sets the
deadline.
Fields
WireFormat(Box<dyn StdError + Send + Sync>)
A value could not be written to, or read from, its binary wire form.
This is the byte lanes’ own failure: the Avro or Protobuf encoder rejected the value,
the payload is not the datum a schema describes, or a delivery does not carry the
Confluent envelope the reader expected. It stays distinct from
SchemaRegistry, which is the registry conversation failing -
the fixed-schema lane reaches no registry at all, so folding the two would make every
diagnostic point at a component that was never involved.
Trait Implementations§
Source§impl Debug for KafkaError
impl Debug for KafkaError
Source§impl Display for KafkaError
impl Display for KafkaError
Source§impl Error for KafkaError
impl Error for KafkaError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for KafkaError
impl !UnwindSafe for KafkaError
impl Freeze for KafkaError
impl Send for KafkaError
impl Sync for KafkaError
impl Unpin for KafkaError
impl UnsafeUnpin for KafkaError
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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> ⓘ
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> ⓘ
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 more