pub struct ClientConfig {
url: Arc<dyn Fn() -> Url + Send + Sync + 'static>,
root_certs: Vec<Certificate>,
identity: Option<Identity>,
auth: Option<Auth>,
dns_overrides: BTreeMap<String, Vec<SocketAddr>>,
}Expand description
Configuration for a Client.
Fields§
§url: Arc<dyn Fn() -> Url + Send + Sync + 'static>§root_certs: Vec<Certificate>§identity: Option<Identity>§auth: Option<Auth>§dns_overrides: BTreeMap<String, Vec<SocketAddr>>Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn new(url: Url) -> ClientConfig
pub fn new(url: Url) -> ClientConfig
Constructs a new ClientConfig that will target the schema registry at
the specified URL.
Sourcepub fn add_root_certificate(self, cert: Certificate) -> ClientConfig
pub fn add_root_certificate(self, cert: Certificate) -> ClientConfig
Adds a trusted root TLS certificate.
Certificates in the system’s certificate store are trusted by default.
A server certificate identical to cert is trusted even if it is not
a valid end-entity certificate, for example a self-signed CA. Its name
and validity period are still checked, and its name may match any
subject common name if it has no DNS or IP subjectAltName.
Sourcepub fn identity(self, identity: Identity) -> ClientConfig
pub fn identity(self, identity: Identity) -> ClientConfig
Enables TLS client authentication with the provided identity.
Sourcepub fn auth(self, username: String, password: Option<String>) -> ClientConfig
pub fn auth(self, username: String, password: Option<String>) -> ClientConfig
Enables HTTP basic authentication with the specified username and optional password.
Sourcepub fn resolve_to_addrs(
self,
domain: &str,
addrs: &[SocketAddr],
) -> ClientConfig
pub fn resolve_to_addrs( self, domain: &str, addrs: &[SocketAddr], ) -> ClientConfig
Overrides DNS resolution for specific domains to the provided IP addresses.
Sourcepub fn dynamic_url<F: Fn() -> Url + Send + Sync + 'static>(
self,
callback: F,
) -> ClientConfig
pub fn dynamic_url<F: Fn() -> Url + Send + Sync + 'static>( self, callback: F, ) -> ClientConfig
Sets a callback that will be used to dynamically override the url the client uses.
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more