#[non_exhaustive]pub enum ProducerError {
Show 22 variants
Client(ClientError),
Protocol(ProtocolError),
Server(i16),
FencedProducer,
InvalidConfig(String),
InvalidPartition(i32),
InvalidTimestamp(i64),
InvalidPartitionerResult(i32),
BatchTooLarge {
batch_size: usize,
},
RecordTooLarge {
record_size: usize,
limit: RecordSizeLimit,
},
BufferExhausted {
size: usize,
max_block: Duration,
total: usize,
available: usize,
poolable: usize,
},
Closed,
FlushTimeout,
MetadataTimeout {
topic: String,
partition: Option<i32>,
partition_count: Option<i32>,
waited: Duration,
},
SendTimeout,
Compression(CompressionError),
NotTransactional,
InvalidTransactionState(&'static str),
TransactionAborted,
ConcurrentTransactions,
RecoveryRequired,
FatalTransactionError(i16),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Client(ClientError)
Protocol(ProtocolError)
Server(i16)
FencedProducer
InvalidConfig(String)
InvalidPartition(i32)
The record names a negative partition. Kafka’s ProducerRecord
constructor throws IllegalArgumentException with the same message.
InvalidTimestamp(i64)
The record carries a negative timestamp. Kafka’s ProducerRecord
constructor throws IllegalArgumentException with the same message.
InvalidPartitionerResult(i32)
A custom partitioner (partitioner.class) returned a negative
partition. Kafka’s KafkaProducer.partition throws
IllegalArgumentException with the same message.
BatchTooLarge
RecordTooLarge
The record is larger than a limit of the producer. Kafka’s
KafkaProducer.ensureValidRecordSize throws RecordTooLargeException
with the same message for each limit.
Fields
limit: RecordSizeLimitThe limit that the record is larger than.
BufferExhausted
send waited max_block (the part of max_block that the metadata
wait left) for buffer memory, and the memory did not become free.
Kafka’s BufferPool.allocate throws BufferExhaustedException with the
same message.
Closed
FlushTimeout
MetadataTimeout
send waited waited (the configured max_block) for metadata that
holds the topic, and the partition of the record when it names one.
Kafka’s KafkaProducer.waitOnMetadata throws TimeoutException with
the same message.
SendTimeout
The batch ran out of retries, or its routing budget ended, before the
broker acknowledged it. Kafka raises TimeoutException for the same
case (Sender.sendProducerData and RecordAccumulator.expiredBatches).
Compression(CompressionError)
NotTransactional
InvalidTransactionState(&'static str)
TransactionAborted
The record’s batch was still queued in the accumulator, undrained,
when the application aborted the transaction. Kafka’s
Sender.maybeSendAndPollTransactionalRequest fails every undrained
batch this way instead of sending it:
accumulator.abortUndrainedBatches(new TransactionAbortedException()).
ConcurrentTransactions
RecoveryRequired
FatalTransactionError(i16)
A transaction coordinator answered with a fatal code, and the
transactional producer can do no more transactional work. Every later
init_transactions, begin_transaction, send,
send_offsets_to_transaction, commit and abort fails with this error.
Kafka’s TransactionManager moves to FATAL_ERROR for the same codes,
and the application can only close the producer.
Trait Implementations§
Source§impl Debug for ProducerError
impl Debug for ProducerError
Source§impl Display for ProducerError
impl Display for ProducerError
Source§impl Error for ProducerError
impl Error for ProducerError
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()
Source§impl From<ClientError> for ProducerError
impl From<ClientError> for ProducerError
Source§impl From<CompressionError> for ProducerError
impl From<CompressionError> for ProducerError
Auto Trait Implementations§
impl !RefUnwindSafe for ProducerError
impl !UnwindSafe for ProducerError
impl Freeze for ProducerError
impl Send for ProducerError
impl Sync for ProducerError
impl Unpin for ProducerError
impl UnsafeUnpin for ProducerError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);