pub struct TlsConnectorConfig {
pub trust_store: TrustStore,
pub key_store: Option<KeyStore>,
pub server_name: String,
pub hostname_verification: bool,
pub protocol: TlsVersion,
pub enabled_protocols: Vec<TlsVersion>,
pub cipher_suites: Option<Vec<String>>,
/* private fields */
}Expand description
Client-side TLS settings, as Kafka’s SslConfigs defines them.
Default gives Kafka’s defaults: the platform trust store, no client
certificate, hostname verification on, ssl.protocol=TLSv1.3,
ssl.enabled.protocols=TLSv1.2,TLSv1.3, and the default cipher suites.
Fields§
§trust_store: TrustStoreThe CA certificates that verify the broker certificate.
key_store: Option<KeyStore>The client certificate and key for mutual TLS. None presents no
client certificate.
server_name: StringExplicit SNI / server-name override. An empty string uses each connection’s target hostname, including brokers learned from metadata.
hostname_verification: boolWhether the client checks that the broker certificate names the host
it connects to. Kafka’s ssl.endpoint.identification.algorithm=https
(the default) turns it on, and an empty value turns it off. With the
check off, the client still verifies the certificate chain.
protocol: TlsVersionThe highest protocol version that the client uses (ssl.protocol).
enabled_protocols: Vec<TlsVersion>The protocol versions that the client offers
(ssl.enabled.protocols).
cipher_suites: Option<Vec<String>>The cipher suites that the client offers, by IANA name
(ssl.cipher.suites). None offers the default suites. The client
skips a known suite name that it does not implement, such as a CBC
suite.
Implementations§
Source§impl TlsConnectorConfig
impl TlsConnectorConfig
Sourcepub fn build(&self) -> Result<Arc<ClientConfig>, TlsConfigError>
pub fn build(&self) -> Result<Arc<ClientConfig>, TlsConfigError>
Build a rustls::ClientConfig.
§Errors
Returns TlsConfigError when a store does not load, when a protocol
or cipher suite setting leaves nothing to offer, or when the platform
trust store is empty or, on WebAssembly, absent.
Sourcepub fn connector(&self) -> Result<TlsConnector, TlsConfigError>
pub fn connector(&self) -> Result<TlsConnector, TlsConfigError>
Build a ready TlsConnector.
The first call builds the client configuration, and later calls on this value or its clones reuse it while the settings stay the same. A store file that changes after the first build therefore does not change the connections, as a Kafka client reads its stores once.
§Errors
Propagates Self::build failures.
Trait Implementations§
Source§impl Clone for TlsConnectorConfig
impl Clone for TlsConnectorConfig
Source§fn clone(&self) -> TlsConnectorConfig
fn clone(&self) -> TlsConnectorConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TlsConnectorConfig
impl Debug for TlsConnectorConfig
Source§impl Default for TlsConnectorConfig
impl Default for TlsConnectorConfig
impl Eq for TlsConnectorConfig
Source§impl PartialEq for TlsConnectorConfig
impl PartialEq for TlsConnectorConfig
Source§fn eq(&self, other: &TlsConnectorConfig) -> bool
fn eq(&self, other: &TlsConnectorConfig) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TlsConnectorConfig
Auto Trait Implementations§
impl Freeze for TlsConnectorConfig
impl RefUnwindSafe for TlsConnectorConfig
impl Send for TlsConnectorConfig
impl Sync for TlsConnectorConfig
impl Unpin for TlsConnectorConfig
impl UnsafeUnpin for TlsConnectorConfig
impl UnwindSafe for TlsConnectorConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);