#[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>),
NotConnected,
InvalidOptions(String),
TransactionBusy,
}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.
NotConnected
An operation needed the live connection before Broker::connect resolved it.
The runtime connects the broker once at startup; a publisher handed out earlier resolves
the shared connection on first use. Seeing this error means the operation ran before
connect completed.
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.
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()