aquarium_control/permission/
schedule_check_config.rs

1/* Copyright 2025 Uwe Martin
2
3Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
5The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
7THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8*/
9use serde_derive::Deserialize;
10
11/// Holds the configuration data for the schedule checker.
12/// The configuration is loaded from the .toml configuration file.
13/// This struct does not contain any implementation.
14#[derive(Deserialize)]
15pub struct ScheduleCheckConfig {
16    /// reading from the database only happens when the flag is true
17    pub active: bool,
18
19    /// indicates if the thread shall be started or not
20    pub execute: bool,
21
22    /// interval for polling the SQL database
23    pub schedule_check_interval: u32,
24
25    /// strategy if entry could not be found in the database:
26    /// - true allows actuation
27    /// - false inhibits actuation
28    pub strategy_if_schedule_not_found: bool,
29}