redup_bootstrap/
rest_config.rs1use redup_config::Config;
4
5#[derive(Debug, Clone, PartialEq, Eq, Config)]
7pub struct RestConfig {
8 host: String,
10 port: u16,
12 concurrent_requests_limit: u32,
14 compression_threshold: u64,
16}
17
18impl Default for RestConfig {
19 fn default() -> Self {
20 Self {
21 host: "0.0.0.0".to_owned(),
22 port: 8080,
23 concurrent_requests_limit: 128,
24 compression_threshold: 1024,
25 }
26 }
27}
28
29impl RestConfig {
30 pub fn host(&self) -> &str {
32 &self.host
33 }
34
35 pub fn port(&self) -> u16 {
37 self.port
38 }
39
40 pub fn concurrent_requests_limit(&self) -> u32 {
42 self.concurrent_requests_limit
43 }
44
45 pub fn compression_threshold(&self) -> u64 {
47 self.compression_threshold
48 }
49}