pub fn load_from_toml(file: &str) -> Result<Self, MetaError> {
        let txt = std::fs::read_to_string(file)
            .map_err(|e| MetaError::LoadConfigError(format!("File: {}, err: {:?}", file, e)))?;

        let cfg = toml::from_str::<Config>(txt.as_str())
            .map_err(|e| MetaError::LoadConfigError(format!("{:?}", e)))?;

        cfg.check()?;
        Ok(cfg)
    }
/// Load configs from toml file.
Load configs from toml file.
Load configs from toml file .
pub fn load_from_toml(file: &str) -> Result<Self, MetaError> {
        let txt = std::fs::read_to_string(file)
            .map_err(|e| MetaError::LoadConfigError(format!("File: {}, err: {:?}", file, e)))?;
        let cfg = toml::from_str::<Config>(txt.as_str())
            .map_err(|e| MetaError::LoadConfigError(format!("{:?}", e)))?;
        cfg.check()?;
        Ok(cfg)
    }
pub fn load_from_toml ( file : & str ) -> Result < Self , MetaError > { let txt = std :: fs :: read_to_string ( file ) . map_err ( | e | MetaError :: LoadConfigError ( format ! ( " " file e ) ) ) ? ; let cfg = toml :: from_str :: < Config > ( txt . as_str ( ) ) . map_err ( | e | MetaError :: LoadConfigError ( format ! ( " " e ) ) ) ? ; cfg . check ( ) ? ; Ok ( cfg ) }
Load configs from toml file.
Load configs from toml file .
file
&str