pub struct TopicAuthorizationError { /* private fields */ }Expand description
Topic authorization failure with the set of unauthorized topics.
Corresponds to Java’s TopicAuthorizationException, error code
Errors::TopicAuthorizationFailed.
Java extends chain:
TopicAuthorizationException -> AuthorizationException ->
InvalidConfigurationException -> ApiException -> KafkaException
Fatal per RequestUtils.isFatalException.
Implementations§
Source§impl TopicAuthorizationError
impl TopicAuthorizationError
Sourcepub fn new(unauthorized_topics: HashSet<String>) -> Self
pub fn new(unauthorized_topics: HashSet<String>) -> Self
Create a topic authorization error, formatting the topics into the message.
Mirrors Java’s TopicAuthorizationException(Set<String> unauthorizedTopics):
this("Not authorized to access topics: " + unauthorizedTopics, unauthorizedTopics).
Sourcepub fn with_default_message() -> Self
pub fn with_default_message() -> Self
Create a topic authorization error with the code’s default message and no topics.
Mirrors Java’s TopicAuthorizationException(String message) reached via
the Errors.TOPIC_AUTHORIZATION_FAILED builder (exception()), where the
message is the default constant and the topic set is empty.
Sourcepub fn with_message(
unauthorized_topics: HashSet<String>,
message: impl Into<String>,
) -> Self
pub fn with_message( unauthorized_topics: HashSet<String>, message: impl Into<String>, ) -> Self
Create a topic authorization error carrying a custom message.
Mirrors Java’s TopicAuthorizationException(String message, Set<String>)
(TopicAuthorizationException.java:25), where the message is
caller-supplied rather than the code’s default text.
The two translated constructors intersect on {unauthorizedTopics}, which
is exactly TopicAuthorizationException(Set<String>) (:30) — 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.
The set of unauthorized topics. Mirrors Java’s
TopicAuthorizationException.unauthorizedTopics().
Source§impl TopicAuthorizationError
impl TopicAuthorizationError
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 TopicAuthorizationError
impl Clone for TopicAuthorizationError
Source§fn clone(&self) -> TopicAuthorizationError
fn clone(&self) -> TopicAuthorizationError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more