#[non_exhaustive]pub enum SecurityProtocol {
Plaintext,
Ssl,
SaslPlaintext,
SaslSsl,
}Expand description
Defines the security protocol used for communication with Kafka brokers.
Each protocol has a permanent, immutable numeric ID that matches the wire-protocol values used by the Java client.
Translated from org.apache.kafka.common.security.auth.SecurityProtocol.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Plaintext
Un-authenticated, non-encrypted channel.
Ssl
SSL channel.
SaslPlaintext
SASL authenticated, non-encrypted channel.
SaslSsl
SASL authenticated, SSL channel.
Implementations§
Source§impl SecurityProtocol
impl SecurityProtocol
Sourcepub fn id(self) -> i16
pub fn id(self) -> i16
Returns the permanent and immutable numeric ID for this security protocol.
This value matches kafka.cluster.SecurityProtocol and must never change.
Sourcepub fn name(self) -> &'static str
pub fn name(self) -> &'static str
Returns the protocol name as used in configuration (e.g. "PLAINTEXT", "SASL_SSL").
Sourcepub fn for_id(id: i16) -> Option<Self>
pub fn for_id(id: i16) -> Option<Self>
Looks up a security protocol by its numeric ID.
Returns None if no protocol has the given ID.
Trait Implementations§
Source§impl Clone for SecurityProtocol
impl Clone for SecurityProtocol
Source§fn clone(&self) -> SecurityProtocol
fn clone(&self) -> SecurityProtocol
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SecurityProtocol
impl Debug for SecurityProtocol
Source§impl Display for SecurityProtocol
impl Display for SecurityProtocol
Source§impl FromStr for SecurityProtocol
impl FromStr for SecurityProtocol
Source§impl Hash for SecurityProtocol
impl Hash for SecurityProtocol
Source§impl PartialEq for SecurityProtocol
impl PartialEq for SecurityProtocol
impl Copy for SecurityProtocol
impl Eq for SecurityProtocol
impl StructuralPartialEq for SecurityProtocol
Auto Trait Implementations§
impl Freeze for SecurityProtocol
impl RefUnwindSafe for SecurityProtocol
impl Send for SecurityProtocol
impl Sync for SecurityProtocol
impl Unpin for SecurityProtocol
impl UnsafeUnpin for SecurityProtocol
impl UnwindSafe for SecurityProtocol
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more