pub fn load_from(path: impl AsRef<Path>) -> Result<Self> {
        let path = path.as_ref();
        info!("Loading configuration from '{}'", path.display());

        let file = fs::read_to_string(path)
            .context(format!("failed to open '{}' as configuration file", path.display()))?;
        let raw: raw::Config = toml::from_str(&file)
            .context(format!("failed to deserialize '{}' as configuration", path.display()))?;
        let merged = raw::Config::default_values().overwrite_with(raw);
        let mut config: Self = merged.try_into()?;

        config.validate().context("failed to validate configuration")?;
        config.fix_paths(path)?;

        Ok(config)
    }
/// Loads the configuration from a specific TOML file.
Loads the configuration from a specific TOML file.
Loads the configuration from a specific TOML file .
pub fn load_from(path: impl AsRef<Path>) -> Result<Self> {
        let path = path.as_ref();
        info!("Loading configuration from '{}'", path.display());
        let file = fs::read_to_string(path)
            .context(format!("failed to open '{}' as configuration file", path.display()))?;
        let raw: raw::Config = toml::from_str(&file)
            .context(format!("failed to deserialize '{}' as configuration", path.display()))?;
        let merged = raw::Config::default_values().overwrite_with(raw);
        let mut config: Self = merged.try_into()?;
        config.validate().context("failed to validate configuration")?;
        config.fix_paths(path)?;
        Ok(config)
    }
pub fn load_from ( path : impl AsRef < Path > ) -> Result < Self > { let path = path . as_ref ( ) ; info ! ( " " path display ( ) ) ; let file = fs :: read_to_string ( path ) . context ( format ! ( " " path display ( ) ) ) ? ; let raw : raw :: Config = toml :: from_str ( & file ) . context ( format ! ( " " path display ( ) ) ) ? ; let merged = raw :: Config :: default_values ( ) . overwrite_with ( raw ) ; let mut config : Self = merged . try_into ( ) ? ; config . validate ( ) . context ( " " ) ? ; config . fix_paths ( path ) ? ; Ok ( config ) }
Loads the configuration from a specific TOML file.
Loads the configuration from a specific TOML file .
path
impl AsRef<Path>