#[non_exhaustive]pub enum ConsumerError {
Show 27 variants
Client(ClientError),
Protocol(ProtocolError),
RebalanceFailed(String),
RebalanceListenerFailed(String),
InvalidConfig(String),
StartupAfterJoin(Box<ConsumerError>),
NotSubscribed,
IllegalState(String),
InvalidArgument(String),
InvalidTopic(String),
Wakeup,
InvalidGroupId,
Timeout {
message: String,
cause: Option<Box<ConsumerError>>,
},
InvalidOffset(i64),
NoCurrentAssignment {
topic: String,
partition: i32,
},
RetriableCommitFailed(Box<ConsumerError>),
CommitInvalid,
CoordinatorUnavailable,
LogTruncation {
topic: String,
partition: i32,
fetch_offset: i64,
safe_offset: i64,
},
Server(i16),
GroupAuthorizationFailed(String),
TopicAuthorizationFailed(BTreeSet<String>),
OffsetFetchFailed(i16),
FencedInstanceId(String),
CommitFailed,
RebalanceInProgress(String),
NoOffsetForPartition(BTreeSet<(String, i32)>),
}Expand description
Errors returned by Consumer.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Client(ClientError)
Protocol(ProtocolError)
RebalanceFailed(String)
RebalanceListenerFailed(String)
A rebalance listener callback failed. Kafka’s poll throws a
KafkaException with the cause.
InvalidConfig(String)
A builder setting is not valid. Kafka’s ConfigException.
StartupAfterJoin(Box<ConsumerError>)
NotSubscribed
IllegalState(String)
InvalidArgument(String)
An argument of a call is not valid. Kafka’s IllegalArgumentException.
InvalidTopic(String)
The broker answered INVALID_TOPIC_EXCEPTION for the topic. Kafka’s
InvalidTopicException.
Wakeup
WakeupHandle::wakeup woke the call.
Kafka’s WakeupException.
InvalidGroupId
The call needs a group, and the consumer has no group id. Kafka’s
InvalidGroupIdException.
Timeout
A call did not complete before its timeout. Kafka’s
TimeoutException.
cause is the last retriable error when a retry loop ran out of time,
as Kafka’s CommitRequestManager.maybeWrapAsTimeoutException wraps it.
It is None when the call ran out of time while it waited.
InvalidOffset(i64)
NoCurrentAssignment
The call names a partition that the consumer does not own. Kafka’s
SubscriptionState.assignedState raises IllegalStateException.
RetriableCommitFailed(Box<ConsumerError>)
An asynchronous commit failed with a retriable error. A later commit
can succeed. Kafka’s consumer gives RetriableCommitFailedException to
the OffsetCommitCallback.
CommitInvalid
LogTruncation
Server(i16)
GroupAuthorizationFailed(String)
The coordinator answered GROUP_AUTHORIZATION_FAILED (30) for the
group. Kafka’s consumer raises GroupAuthorizationException.
TopicAuthorizationFailed(BTreeSet<String>)
The coordinator answered TOPIC_AUTHORIZATION_FAILED (29) for
partitions of these topics. Kafka’s consumer raises
TopicAuthorizationException.
OffsetFetchFailed(i16)
An OffsetFetch response carried an error code that Kafka’s consumer
does not retry.
FencedInstanceId(String)
The coordinator answered FENCED_INSTANCE_ID (82) for this
group.instance.id, because another consumer joined with the same
id. poll returns this error once. The next poll joins the group
again. Kafka’s consumer raises FencedInstanceIdException.
CommitFailed
A commit found that the consumer is not part of an active group:
a fatal coordinator error removed the member and no poll joined the
group again yet, or the coordinator task stopped. Kafka’s consumer raises
CommitFailedException.
RebalanceInProgress(String)
The coordinator answered ILLEGAL_GENERATION (22), UNKNOWN_MEMBER_ID
(25) or FENCED_INSTANCE_ID (82) while the group was still
PREPARING_REBALANCE, or REBALANCE_IN_PROGRESS (27). Kafka’s
ConsumerCoordinator.OffsetCommitResponseHandler raises
RebalanceInProgressException for these, and commitOffsetsSync does
not retry: the offsets are not committed, and the caller must call
poll() to finish the rebalance before it commits again.
NoOffsetForPartition(BTreeSet<(String, i32)>)
A partition has no committed offset and auto.offset.reset = none.
Kafka never auto-resets under none
(SubscriptionState.resetInitializingPositions); it raises
NoOffsetForPartitionException from poll() and position() instead.
Trait Implementations§
Source§impl Debug for ConsumerError
impl Debug for ConsumerError
Source§impl Display for ConsumerError
impl Display for ConsumerError
Source§impl Error for ConsumerError
impl Error for ConsumerError
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 ConsumerError
impl From<ClientError> for ConsumerError
Source§fn from(source: ClientError) -> Self
fn from(source: ClientError) -> Self
Source§impl From<ProtocolError> for ConsumerError
impl From<ProtocolError> for ConsumerError
Source§fn from(source: ProtocolError) -> Self
fn from(source: ProtocolError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for ConsumerError
impl !UnwindSafe for ConsumerError
impl Freeze for ConsumerError
impl Send for ConsumerError
impl Sync for ConsumerError
impl Unpin for ConsumerError
impl UnsafeUnpin for ConsumerError
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
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> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§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();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§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();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§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();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§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();Source§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.
Source§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);