1use std::time::Duration;
4
5#[derive(Debug, Clone, Copy, PartialEq, Eq)]
7pub struct RetryPolicy {
8 pub max_retries: u32,
10 pub delay: Duration,
12}
13
14impl Default for RetryPolicy {
15 fn default() -> Self {
16 Self {
17 max_retries: 3,
18 delay: Duration::from_millis(1000),
19 }
20 }
21}
22
23#[derive(Debug, Clone, PartialEq, Eq)]
25pub struct ProxyConfig {
26 pub url: String,
28 pub username: Option<String>,
30 pub password: Option<String>,
32}
33
34impl ProxyConfig {
35 pub fn new(url: impl Into<String>) -> Self {
37 Self {
38 url: url.into(),
39 username: None,
40 password: None,
41 }
42 }
43
44 pub fn with_credentials(
46 mut self,
47 username: impl Into<String>,
48 password: impl Into<String>,
49 ) -> Self {
50 self.username = Some(username.into());
51 self.password = Some(password.into());
52 self
53 }
54}