use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ListenerProtocol {
Plaintext,
Ssl,
SaslPlaintext,
SaslSsl,
}
impl ListenerProtocol {
#[must_use]
pub fn requires_tls(self) -> bool {
matches!(self, Self::Ssl | Self::SaslSsl)
}
#[must_use]
pub fn requires_sasl(self) -> bool {
matches!(self, Self::SaslPlaintext | Self::SaslSsl)
}
}