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
use std::time::Duration;
#[derive(Debug)]
pub struct Config {
pub is_discard_rdb: bool,
pub is_aof: bool,
pub host: String,
pub port: u16,
pub username: String,
pub password: String,
pub repl_id: String,
pub repl_offset: i64,
pub read_timeout: Option<Duration>,
pub write_timeout: Option<Duration>,
pub is_tls_enabled: bool,
pub is_tls_insecure: bool,
pub identity: Option<String>,
pub identity_passwd: Option<String>,
}
impl Clone for Config {
fn clone(&self) -> Self {
Config {
is_discard_rdb: self.is_discard_rdb,
is_aof: self.is_aof,
host: self.host.clone(),
port: self.port.clone(),
username: self.username.clone(),
password: self.password.clone(),
repl_id: self.repl_id.clone(),
repl_offset: self.repl_offset,
read_timeout: self.read_timeout,
write_timeout: self.write_timeout,
is_tls_enabled: self.is_tls_enabled,
is_tls_insecure: self.is_tls_insecure,
identity: self.identity.clone(),
identity_passwd: self.identity_passwd.clone(),
}
}
}