Struct mz_ccsr::ClientConfig
source · 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.
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
Returns a copy 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 moreAuto Trait Implementations§
impl Freeze for ClientConfig
impl !RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl !UnwindSafe for ClientConfig
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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)