pub struct InvalidTopicError { /* private fields */ }Expand description
The client has attempted to perform an operation on an invalid topic. For example the topic name is too long, contains invalid characters etc. This error is not retriable because the operation won’t suddenly become valid.
§See also
UnknownTopicOrPartitionError
§Translation notes
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
Creates an invalid topic error with the message "Invalid topics: [<topics>]".
§Arguments
invalid_topics- the invalid topics
Sourcepub fn with_default_message() -> Self
pub fn with_default_message() -> Self
Creates an invalid topic error with the default message of Errors::InvalidTopicError
and an empty set of topics, as the broker’s error code is turned into an error.
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
Creates an invalid topic error carrying a custom message.
§Arguments
invalid_topics- the invalid topicsmessage- the error’s message
Sourcepub fn kafka_error(&self) -> &KafkaError
pub fn kafka_error(&self) -> &KafkaError
Returns the embedded KafkaError base, holding the error code, message and source.
Sourcepub fn invalid_topics(&self) -> &HashSet<String>
pub fn invalid_topics(&self) -> &HashSet<String>
Returns the set of invalid topics, empty when the error was not built from them.
Source§impl InvalidTopicError
impl InvalidTopicError
Sourcepub fn source(&self) -> Option<&Error>
pub fn source(&self) -> Option<&Error>
Returns the underlying cause, if any, held by the embedded KafkaError base: Java’s
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