pub struct Builder {
#[cfg(feature = "with-rustls")]
config: Arc<ClientConfig>,
}
impl Default for Builder {
#[cfg(not(feature = "with-rustls"))]
fn default() -> Self {
Self {}
}
#[cfg(feature = "with-rustls")]
fn default() -> Self {
let mut config = ClientConfig::new();
config
.root_store
.add_server_trust_anchors(&webpki_roots::TLS_SERVER_ROOTS);
let config = Arc::new(config);
Self { config }
}
}
impl Builder {
#[cfg(feature = "with-rustls")]
pub fn rustls_config(&mut self, config: ClientConfig) -> &mut Self {
self.config = Arc::new(config);
self
}
}