Struct mpot_http::Configuration
source · pub struct Configuration {
pub send_mail: SendMail,
pub db_path: PathBuf,
pub data_path: PathBuf,
pub administrators: Vec<String, Global>,
}
Expand description
The configuration for the mailpot database and the mail server.
Fields§
§send_mail: SendMail
How to send e-mail.
db_path: PathBuf
The location of the sqlite3 file.
data_path: PathBuf
The directory where data are stored.
administrators: Vec<String, Global>
Instance administrators (List of e-mail addresses). Optional.
Implementations§
source§impl Configuration
impl Configuration
sourcepub fn new(db_path: impl Into<PathBuf>) -> Configuration
pub fn new(db_path: impl Into<PathBuf>) -> Configuration
Create a new configuration value from a given database path value.
If you wish to create a new database with this configuration, use
Connection::open_or_create_db
.
To open an existing database, use
Database::open_db
.
sourcepub fn from_file<P>(path: P) -> Result<Configuration, Error>where
P: AsRef<Path>,
pub fn from_file<P>(path: P) -> Result<Configuration, Error>where P: AsRef<Path>,
Deserialize configuration from TOML file.
sourcepub fn data_directory(&self) -> &Path
pub fn data_directory(&self) -> &Path
The saved data path.
sourcepub fn save_message_to_path(
&self,
msg: &str,
path: PathBuf
) -> Result<PathBuf, Error>
pub fn save_message_to_path( &self, msg: &str, path: PathBuf ) -> Result<PathBuf, Error>
Save message to a custom path.
Trait Implementations§
source§impl Clone for Configuration
impl Clone for Configuration
source§fn clone(&self) -> Configuration
fn clone(&self) -> Configuration
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Configuration
impl Debug for Configuration
source§impl<'de> Deserialize<'de> for Configuration
impl<'de> Deserialize<'de> for Configuration
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Configuration, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Configuration, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Serialize for Configuration
impl Serialize for Configuration
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more