pub struct Config {Show 16 fields
pub username: String,
pub password: String,
pub smtp_server: String,
pub smtp_port: u16,
pub message: String,
pub message_warning: String,
pub subject: String,
pub subject_warning: String,
pub to: String,
pub from: String,
pub attachment: Option<String>,
pub timer_warning: u64,
pub timer_dead_man: u64,
pub web_password: String,
pub cookie_exp_days: u64,
pub log_level: Option<String>,
}Expand description
Configuration struct used for the application
§Default
If the configuration file does not exist, it will be created with the default values.
Fields§
§username: StringThe username for the email account.
password: StringThe password for the email account.
smtp_server: StringThe SMTP server to use
smtp_port: u16The port to use for the SMTP server.
message: StringThe message to send in the email if you fail to check in
after the timer_warning with the additional timer_dead_man
seconds have passed.
message_warning: StringThe warning message if you fail to check in timer_warning seconds.
subject: StringThe subject of the email if you fail to check in
after the timer_warning with the additional timer_dead_man
seconds have passed.
subject_warning: StringThe subject of the email if you fail to check in timer_warning seconds.
to: StringThe email address to send the email to.
from: StringThe email address to send the email from.
attachment: Option<String>Attachment to send with the email.
timer_warning: u64Timer in seconds for the warning email.
timer_dead_man: u64Timer in seconds for the dead man’s email.
web_password: StringWeb interface password
Cookie expiration to avoid need for login
log_level: Option<String>Log level for the web interface.
Implementations§
Source§impl Config
impl Config
Sourcepub fn send_email(&self, email_type: Email) -> Result<(), EmailError>
pub fn send_email(&self, email_type: Email) -> Result<(), EmailError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.