pub struct Settings {
pub log_level: String,
pub overwrite: bool,
pub debug_model: bool,
pub results_root: PathBuf,
pub graph_results_root: PathBuf,
}Expand description
Program settings from config file
NOTE: If you add or change a field in this struct, you must also update the schema in
schemas/settings.yaml.
Fields§
§log_level: StringThe default program log level
overwrite: boolWhether to overwrite output files by default
debug_model: boolWhether to write additional information to CSV files
results_root: PathBufResults root path to save MUSE2 results. Defaults to muse2_results.
graph_results_root: PathBufResults root path to save MUSE2 graph outputs. Defaults to muse2_graphs.
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn load_or_default() -> Result<Settings>
pub fn load_or_default() -> Result<Settings>
Read the contents of a settings file from the global MUSE2 configuration directory.
If the file is not present or the user has set the MUSE2_USE_DEFAULT_SETTINGS environment
variable to 1, then the default settings will be used.
§Returns
The program settings as a Settings struct or an error if loading fails.
Sourcefn from_path_or_default(file_path: &Path) -> Result<Settings>
fn from_path_or_default(file_path: &Path) -> Result<Settings>
Try to read settings from the specified path, returning Settings::default() if it doesn’t
exist
Sourcepub fn default_file_contents() -> String
pub fn default_file_contents() -> String
The contents of the default settings file.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Settings
impl<'de> Deserialize<'de> for Settings
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>,
Source§impl DocumentedFields for Settings
impl DocumentedFields for Settings
Source§const FIELD_NAMES: &'static [&'static str]
const FIELD_NAMES: &'static [&'static str]
Self::get_field_docs]. Read moreSource§const FIELD_DOCS: &'static [&'static str]
const FIELD_DOCS: &'static [&'static str]
impl StructuralPartialEq for Settings
Auto Trait Implementations§
impl Freeze for Settings
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnwindSafe for Settings
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more