1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use hyper::body::HttpBody;
pub use hyper::client::{Builder, Client};
use hyper::client::connect::Connect;
pub use hyper::client::connect::HttpConnector;
#[cfg(feature = "https")]
#[cfg_attr(docsrs, doc(cfg(feature = "https")))]
pub use hyper_tls::HttpsConnector;
pub fn builder() -> Builder {
Builder::default()
}
pub fn http_default<B>() -> Client<HttpConnector, B>
where
B: HttpBody + Send,
B::Data: Send,
{
Builder::default().build_http()
}
#[cfg(feature = "https")]
#[cfg_attr(docsrs, doc(cfg(feature = "https")))]
pub fn https_default<B>() -> Client<HttpsConnector<HttpConnector>, B>
where
B: HttpBody + Send,
B::Data: Send,
{
Builder::default().build(HttpsConnector::new())
}
pub fn with_connector_default<C, B>(conn: C) -> Client<C, B>
where
C: Connect + Clone,
B: HttpBody + Send,
B::Data: Send,
{
Builder::default().build(conn)
}