Trait config_file2::LoadConfigFile
source · pub trait LoadConfigFile {
// Required method
fn load_with_specific_format(
path: impl AsRef<Path>,
config_type: ConfigFormat,
) -> Result<Self>
where Self: Sized;
// Provided methods
fn load(path: impl AsRef<Path>) -> Result<Self>
where Self: Sized { ... }
fn load_or_default(path: impl AsRef<Path>) -> Result<Self>
where Self: Sized + Default { ... }
}Expand description
Trait for loading a struct from a configuration file.
This trait is automatically implemented when serde::Deserialize is.
Required Methods§
sourcefn load_with_specific_format(
path: impl AsRef<Path>,
config_type: ConfigFormat,
) -> Result<Self>where
Self: Sized,
fn load_with_specific_format(
path: impl AsRef<Path>,
config_type: ConfigFormat,
) -> Result<Self>where
Self: Sized,
Load config from path with specific format, do not use extension to determine.