zero4rs 2.0.0

zero4rs is a powerful, pragmatic, and extremely fast web framework for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#[derive(serde::Deserialize, Clone)]
pub struct Settings {
    pub server: Option<String>,
    pub enable: Option<bool>,
}

impl Settings {
    pub fn enabled(&self) -> bool {
        if let Some(mode) = &self.enable {
            *mode
        } else {
            true
        }
    }
}