2017-09-01 15:24:32 +03:00
|
|
|
/*
|
|
|
|
* meli - configuration module.
|
|
|
|
*
|
|
|
|
* Copyright 2017 Manos Pitsidianakis
|
2017-09-07 23:00:08 +03:00
|
|
|
*
|
2017-09-01 15:24:32 +03:00
|
|
|
* This file is part of meli.
|
|
|
|
*
|
|
|
|
* meli is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* meli is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with meli. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2019-05-14 21:47:47 +03:00
|
|
|
#[derive(Debug, Serialize, Default, Clone)]
|
2017-09-14 18:08:14 +03:00
|
|
|
pub struct AccountSettings {
|
2018-08-19 13:12:48 +03:00
|
|
|
pub name: String,
|
|
|
|
pub root_folder: String,
|
|
|
|
pub format: String,
|
2017-09-01 15:24:32 +03:00
|
|
|
pub sent_folder: String,
|
2018-08-30 15:54:30 +03:00
|
|
|
pub identity: String,
|
|
|
|
pub display_name: Option<String>,
|
2017-09-01 15:24:32 +03:00
|
|
|
}
|
2017-09-30 20:02:22 +03:00
|
|
|
|
|
|
|
impl AccountSettings {
|
2018-07-20 12:44:04 +03:00
|
|
|
pub fn format(&self) -> &str {
|
2017-09-30 20:02:22 +03:00
|
|
|
&self.format
|
|
|
|
}
|
2018-07-20 12:44:04 +03:00
|
|
|
pub fn name(&self) -> &str {
|
2018-07-11 23:12:25 +03:00
|
|
|
&self.name
|
|
|
|
}
|
2018-08-30 15:54:30 +03:00
|
|
|
pub fn set_name(&mut self, s: String) {
|
|
|
|
self.name = s;
|
|
|
|
}
|
2018-08-11 18:00:21 +03:00
|
|
|
pub fn root_folder(&self) -> &str {
|
|
|
|
&self.root_folder
|
|
|
|
}
|
2018-08-30 15:54:30 +03:00
|
|
|
pub fn identity(&self) -> &str {
|
|
|
|
&self.identity
|
|
|
|
}
|
|
|
|
pub fn display_name(&self) -> Option<&String> {
|
|
|
|
self.display_name.as_ref()
|
|
|
|
}
|
2017-09-30 20:02:22 +03:00
|
|
|
}
|