next_web_dev/autoconfigure/context/
mongodb_properties.rs

1#[derive(Debug, serde::Deserialize, Clone)]
2pub struct MongoDBProperties {
3    username: Option<String>,
4    password: Option<String>,
5    host: Option<String>,
6    port: Option<u16>,
7    database: Option<String>,
8    zstd: bool,
9}
10
11impl MongoDBProperties {
12    
13    pub fn username(&self) -> Option<&str> {
14        self.username.as_deref()
15    }
16
17    pub fn password(&self) -> Option<&str> {
18        self.password.as_deref()
19    }
20
21    pub fn host(&self) -> Option<&str> {
22        self.host.as_deref()
23    }
24
25    pub fn port(&self) -> Option<u16> {
26        self.port
27    }
28
29    pub fn database(&self) -> Option<&str> {
30        self.database.as_deref()
31    }
32
33    pub fn zstd(&self) -> bool {
34        self.zstd
35    }
36}