pub fn load_from_toml_str(toml_str: &str) -> Result<Self> {
        let mut cfg = Config::from_args_with_toml(toml_str)
            .map_err(|e| ErrorCode::BadArguments(format!("{:?}", e)))?;
        if cfg.query.num_cpus == 0 {
            cfg.query.num_cpus = num_cpus::get() as u64;
        }
        Ok(cfg)
    }
/// Load configs from toml str.
Load configs from toml str.
Load configs from toml str .
pub fn load_from_toml_str(toml_str: &str) -> Result<Self> {
        let mut cfg = Config::from_args_with_toml(toml_str)
            .map_err(|e| ErrorCode::BadArguments(format!("{:?}", e)))?;
        if cfg.query.num_cpus == 0 {
            cfg.query.num_cpus = num_cpus::get() as u64;
        }
        Ok(cfg)
    }
pub fn load_from_toml_str ( toml_str : & str ) -> Result < Self > { let mut cfg = Config :: from_args_with_toml ( toml_str ) . map_err ( | e | ErrorCode :: BadArguments ( format ! ( " " e ) ) ) ? ; if cfg . query . num_cpus == 0 { cfg . query . num_cpus = num_cpus :: get ( ) as u64 ; } Ok ( cfg ) }
Load configs from toml str.
Load configs from toml str .
toml_str
&str
toml_str
&str