pub struct TopicAuthorizationError { /* private fields */ }Expand description
Topic authorization failure with the set of unauthorized topics.
Error code Errors::TopicAuthorizationFailed. Java extends chain:
TopicAuthorizationException -> AuthorizationException -> InvalidConfigurationException ->
ApiException -> KafkaException. Fatal per common::requests::request_utils::is_fatal_error.
Implementations§
Source§impl TopicAuthorizationError
impl TopicAuthorizationError
Sourcepub fn new(unauthorized_topics: HashSet<String>) -> Self
pub fn new(unauthorized_topics: HashSet<String>) -> Self
Creates a topic authorization error with the message
"Not authorized to access topics: [<topics>]".
§Arguments
unauthorized_topics- the topics that failed authorization
Sourcepub fn with_default_message() -> Self
pub fn with_default_message() -> Self
Creates a topic authorization error with the default message of
Errors::TopicAuthorizationFailed and an empty set of topics, as the broker’s error code
is turned into an error.
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
Creates a topic authorization error carrying a custom message.
§Arguments
unauthorized_topics- the topics that failed authorizationmessage- 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.
Get the set of topics which failed authorization. May be empty if the set is not known in the context the error was raised in.
§Returns
possibly empty set of unauthorized topics
Source§impl TopicAuthorizationError
impl TopicAuthorizationError
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 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