pub struct ConsumerNoOffsetForPartitionError { /* private fields */ }Expand description
No offset is defined for one or more partitions and no reset policy is set.
Corresponds to Java’s NoOffsetForPartitionException. It has no entry in
Errors, so it carries no protocol code.
Java extends chain:
NoOffsetForPartitionException -> InvalidOffsetException ->
KafkaException
The InvalidOffsetException here is the consumer package’s abstract
class, which extends KafkaException — not the concrete
InvalidOffsetError of
common.errors, which extends ApiException. Hence
is_consumer_invalid_offset_error
rather than is_invalid_offset_error.
Implementations§
Source§impl ConsumerNoOffsetForPartitionError
impl ConsumerNoOffsetForPartitionError
Sourcepub fn new(partition: TopicPartition) -> Self
pub fn new(partition: TopicPartition) -> Self
Create the error for a single partition, mirroring Java’s
NoOffsetForPartitionException(TopicPartition).
Java’s single-partition constructor renders the singular “partition:” while the collection constructor renders “partitions:”; both forms are asserted by tests, so they are built separately rather than routed through one another.
Sourcepub fn for_partitions(
partitions: impl IntoIterator<Item = TopicPartition>,
) -> Self
pub fn for_partitions( partitions: impl IntoIterator<Item = TopicPartition>, ) -> Self
Create the error for a set of partitions, mirroring Java’s
NoOffsetForPartitionException(Collection<TopicPartition>).
Sourcepub fn partitions(&self) -> &HashSet<TopicPartition>
pub fn partitions(&self) -> &HashSet<TopicPartition>
The partitions with no defined offset.
Source§impl ConsumerNoOffsetForPartitionError
impl ConsumerNoOffsetForPartitionError
Sourcepub fn source(&self) -> Option<&Error>
pub fn source(&self) -> Option<&Error>
Always None: NoOffsetForPartitionException exposes no Throwable cause constructor, so its
cause is null in Java too. Present as an inherent method so it shadows
both ErrorSource::source and std::error::Error::source, keeping
x.source() unambiguous and typed.
Trait Implementations§
Source§impl Clone for ConsumerNoOffsetForPartitionError
impl Clone for ConsumerNoOffsetForPartitionError
Source§fn clone(&self) -> ConsumerNoOffsetForPartitionError
fn clone(&self) -> ConsumerNoOffsetForPartitionError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more