pub struct SecurityConfig { /* private fields */ }Expand description
Security relevant configuration options for KafkaClient.
Implementations§
Source§impl SecurityConfig
impl SecurityConfig
Sourcepub fn new() -> SecurityConfig
pub fn new() -> SecurityConfig
Create a new SecurityConfig with default TLS settings.
Sourcepub fn from_tls_config(tls_config: TlsConfig) -> SecurityConfig
pub fn from_tls_config(tls_config: TlsConfig) -> SecurityConfig
Create a SecurityConfig from a TlsConfig
Sourcepub fn with_hostname_verification(self, verify_hostname: bool) -> SecurityConfig
pub fn with_hostname_verification(self, verify_hostname: bool) -> SecurityConfig
Initiates a client-side TLS session with/without performing hostname verification.
Sourcepub fn with_ca_cert(self, path: String) -> SecurityConfig
pub fn with_ca_cert(self, path: String) -> SecurityConfig
Set a custom CA certificate file path
Sourcepub fn with_client_cert(
self,
cert_path: String,
key_path: String,
) -> SecurityConfig
pub fn with_client_cert( self, cert_path: String, key_path: String, ) -> SecurityConfig
Set client certificate and key file paths
Sourcepub fn with_sasl(self, sasl_config: SaslConfig) -> SecurityConfig
pub fn with_sasl(self, sasl_config: SaslConfig) -> SecurityConfig
Sets SASL configuration.
Sourcepub fn with_sasl_plain(
self,
username: String,
password: String,
) -> SecurityConfig
pub fn with_sasl_plain( self, username: String, password: String, ) -> SecurityConfig
Sets SASL/PLAIN username and password.
Sourcepub fn tls_config(&self) -> &TlsConfig
pub fn tls_config(&self) -> &TlsConfig
Returns the underlying TLS configuration.
Sourcepub fn sasl_config(&self) -> Option<&SaslConfig>
pub fn sasl_config(&self) -> Option<&SaslConfig>
Returns optional SASL configuration.
Trait Implementations§
Source§impl Clone for SecurityConfig
impl Clone for SecurityConfig
Source§fn clone(&self) -> SecurityConfig
fn clone(&self) -> SecurityConfig
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 SecurityConfig
Available on crate feature security only.
impl Debug for SecurityConfig
Available on crate feature
security only.Source§impl Default for SecurityConfig
Available on crate feature security only.
impl Default for SecurityConfig
Available on crate feature
security only.Source§fn default() -> SecurityConfig
fn default() -> SecurityConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SecurityConfig
impl RefUnwindSafe for SecurityConfig
impl Send for SecurityConfig
impl Sync for SecurityConfig
impl Unpin for SecurityConfig
impl UnsafeUnpin for SecurityConfig
impl UnwindSafe for SecurityConfig
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