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
use std::time::Duration;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct UserConfig {
pub send_logs: bool,
pub send_logs_rate: Duration,
}
impl Default for UserConfig {
#[inline]
fn default() -> Self {
Self::new()
}
}
impl UserConfig {
#[inline]
pub const fn new() -> Self {
const DAY_SECS: u64 = 86400;
const WEEK_SECS: u64 = DAY_SECS * 7;
Self {
send_logs: false,
send_logs_rate: Duration::from_secs(WEEK_SECS),
}
}
}