pub struct InvalidTopicError { /* private fields */ }Expand description
Invalid topic error with the set of invalid topics.
Corresponds to Java’s InvalidTopicException, error code
Errors::InvalidTopicError.
Java extends chain:
InvalidTopicException -> InvalidConfigurationException ->
ApiException -> KafkaException
Implementations§
Source§impl InvalidTopicError
impl InvalidTopicError
Sourcepub fn new(invalid_topics: HashSet<String>) -> Self
pub fn new(invalid_topics: HashSet<String>) -> Self
Create an invalid topic error, formatting the topics into the message.
Mirrors Java’s InvalidTopicException(Set<String> invalidTopics):
super("Invalid topics: " + invalidTopics).
Sourcepub fn with_default_message() -> Self
pub fn with_default_message() -> Self
Create an invalid topic error with the code’s default message and no topics.
Mirrors Java’s InvalidTopicException(String message) reached via the
Errors.INVALID_TOPIC_EXCEPTION builder (exception()), where the
message is the default constant and the topic set is empty.
Sourcepub fn with_message(
invalid_topics: HashSet<String>,
message: impl Into<String>,
) -> Self
pub fn with_message( invalid_topics: HashSet<String>, message: impl Into<String>, ) -> Self
Create an invalid topic error carrying a custom message.
Mirrors Java’s InvalidTopicException(String message, Set<String> invalidTopics)
(InvalidTopicException.java:60).
The two translated constructors intersect on {invalidTopics}, which is
exactly InvalidTopicException(Set<String>) (:55) — so new
keeps the plain name and this one is suffixed with the parameter beyond the
intersection (CLAUDE.md §2).
Sourcepub fn kafka_error(&self) -> &KafkaError
pub fn kafka_error(&self) -> &KafkaError
Access the base error.
Sourcepub fn invalid_topics(&self) -> &HashSet<String>
pub fn invalid_topics(&self) -> &HashSet<String>
The set of invalid topics. Mirrors Java’s
InvalidTopicException.invalidTopics().
Source§impl InvalidTopicError
impl InvalidTopicError
Sourcepub fn source(&self) -> Option<&Error>
pub fn source(&self) -> Option<&Error>
The underlying source, held by the embedded KafkaError base — Java’s
subclass passes its cause up to super(message, cause). Mirrors
Throwable.getCause().
Trait Implementations§
Source§impl Clone for InvalidTopicError
impl Clone for InvalidTopicError
Source§fn clone(&self) -> InvalidTopicError
fn clone(&self) -> InvalidTopicError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more