forked from torrust/torrust-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmode.rs
More file actions
31 lines (28 loc) · 1 KB
/
Copy pathmode.rs
File metadata and controls
31 lines (28 loc) · 1 KB
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
//! Tracker operation mode types.
//!
//! This module contains the [`PrivateMode`] struct, which holds
//! configuration options that apply when the tracker operates in private mode.
use derive_more::{Constructor, Display};
use serde::{Deserialize, Serialize};
/// Configuration that applies when the tracker is operating in private mode.
#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone, Copy, Constructor, Display)]
pub struct PrivateMode {
/// A flag to disable expiration date for peer keys.
///
/// When true, if the keys is not permanent the expiration date will be
/// ignored. The key will be accepted even if it has expired.
#[serde(default = "PrivateMode::default_check_keys_expiration")]
pub check_keys_expiration: bool,
}
impl Default for PrivateMode {
fn default() -> Self {
Self {
check_keys_expiration: Self::default_check_keys_expiration(),
}
}
}
impl PrivateMode {
fn default_check_keys_expiration() -> bool {
true
}
}