pub struct SpringConfigClientBuilder { /* private fields */ }Expand description
Builder for SpringConfigClient.
Implementations§
Source§impl SpringConfigClientBuilder
impl SpringConfigClientBuilder
Sourcepub fn default_label(self, label: impl Into<String>) -> Self
pub fn default_label(self, label: impl Into<String>) -> Self
Sets a default label used when a request does not provide one explicitly.
Sourcepub fn basic_auth(
self,
username: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn basic_auth( self, username: impl Into<String>, password: impl Into<String>, ) -> Self
Configures HTTP Basic authentication.
Sourcepub fn bearer_auth(self, token: impl Into<String>) -> Self
pub fn bearer_auth(self, token: impl Into<String>) -> Self
Configures Bearer token authentication.
Sourcepub fn danger_accept_invalid_certs(self, enabled: bool) -> Self
pub fn danger_accept_invalid_certs(self, enabled: bool) -> Self
Disables TLS certificate validation.
This should only be enabled for development or controlled test environments that use self-signed or otherwise untrusted certificates.
Sourcepub fn danger_accept_invalid_hostnames(self, enabled: bool) -> Self
pub fn danger_accept_invalid_hostnames(self, enabled: bool) -> Self
Disables TLS hostname validation.
This should only be enabled for development or controlled test environments where the certificate hostname does not match the requested host.
Sourcepub fn danger_accept_invalid_tls(self, enabled: bool) -> Self
pub fn danger_accept_invalid_tls(self, enabled: bool) -> Self
Disables both TLS certificate and hostname validation.
This is a convenience method for local development or smoke tests against environments with broken or private TLS setups. Do not enable this in production.
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
Sets the connect timeout.
Sourcepub fn user_agent(self, value: impl Into<String>) -> Self
pub fn user_agent(self, value: impl Into<String>) -> Self
Sets the User-Agent header.
Sourcepub fn header(
self,
name: impl AsRef<str>,
value: impl AsRef<str>,
) -> Result<Self>
pub fn header( self, name: impl AsRef<str>, value: impl AsRef<str>, ) -> Result<Self>
Adds a default HTTP header that will be sent with every request.
Sourcepub fn build(self) -> Result<SpringConfigClient>
pub fn build(self) -> Result<SpringConfigClient>
Builds the client.
Trait Implementations§
Source§impl Clone for SpringConfigClientBuilder
impl Clone for SpringConfigClientBuilder
Source§fn clone(&self) -> SpringConfigClientBuilder
fn clone(&self) -> SpringConfigClientBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more