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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
use std::iter::FromIterator;
use std::net::SocketAddr;
use std::path::PathBuf;
use std::time::Duration;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum RedirectPolicy {
None,
Follow,
Limit(u32),
}
impl Default for RedirectPolicy {
fn default() -> Self {
RedirectPolicy::None
}
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum ClientCertificate {
PEM {
path: PathBuf,
private_key: Option<PrivateKey>,
},
DER {
path: PathBuf,
private_key: Option<PrivateKey>,
},
P12 {
path: PathBuf,
password: Option<String>,
},
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum PrivateKey {
PEM {
path: PathBuf,
password: Option<String>,
},
DER {
path: PathBuf,
password: Option<String>,
},
}
#[derive(Clone, Debug)]
pub(crate) struct Timeout(pub(crate) Duration);
#[derive(Clone, Debug)]
pub(crate) struct ConnectTimeout(pub(crate) Duration);
#[derive(Clone, Debug)]
pub(crate) struct TcpKeepAlive(pub(crate) Duration);
#[derive(Clone, Debug)]
pub(crate) struct PreferredHttpVersion(pub(crate) http::Version);
#[derive(Clone, Copy, Debug)]
pub(crate) struct TcpNoDelay;
#[derive(Clone, Copy, Debug)]
pub(crate) struct AutoReferer;
#[derive(Clone, Copy, Debug)]
pub(crate) struct MaxUploadSpeed(pub(crate) u64);
#[derive(Clone, Copy, Debug)]
pub(crate) struct MaxDownloadSpeed(pub(crate) u64);
#[derive(Clone, Debug)]
pub(crate) struct DnsServers(pub(crate) Vec<SocketAddr>);
impl FromIterator<SocketAddr> for DnsServers {
fn from_iter<I: IntoIterator<Item = SocketAddr>>(iter: I) -> Self {
DnsServers(Vec::from_iter(iter))
}
}
#[derive(Clone, Debug)]
pub(crate) struct Proxy(pub(crate) http::Uri);
#[derive(Clone, Debug)]
pub(crate) struct SslCiphers(pub(crate) Vec<String>);
impl FromIterator<String> for SslCiphers {
fn from_iter<I: IntoIterator<Item = String>>(iter: I) -> Self {
SslCiphers(Vec::from_iter(iter))
}
}