1use std::time::Duration;
7
8#[derive(Debug)]
10pub struct Config {
11 pub is_discard_rdb: bool,
13 pub is_aof: bool,
15 pub host: String,
17 pub port: u16,
19 pub username: String,
21 pub password: String,
23 pub repl_id: String,
25 pub repl_offset: i64,
27 pub read_timeout: Option<Duration>,
29 pub write_timeout: Option<Duration>,
31 pub is_tls_enabled: bool,
33 pub is_tls_insecure: bool,
35 pub identity: Option<String>,
37 pub identity_passwd: Option<String>,
39}
40
41impl Clone for Config {
42 fn clone(&self) -> Self {
43 Config {
44 is_discard_rdb: self.is_discard_rdb,
45 is_aof: self.is_aof,
46 host: self.host.clone(),
47 port: self.port.clone(),
48 username: self.username.clone(),
49 password: self.password.clone(),
50 repl_id: self.repl_id.clone(),
51 repl_offset: self.repl_offset,
52 read_timeout: self.read_timeout,
53 write_timeout: self.write_timeout,
54 is_tls_enabled: self.is_tls_enabled,
55 is_tls_insecure: self.is_tls_insecure,
56 identity: self.identity.clone(),
57 identity_passwd: self.identity_passwd.clone(),
58 }
59 }
60}