pub fn load_module_config(
    modules_dir: &PathBuf,
    module: &str,
) -> Result<(String, FaaSModuleConfig)> {
    let config = modules_dir.join(file_names::module_config_name(module));
    let config = std::fs::read(&config).map_err(|err| NoModuleConfig { path: config, err })?;
    let config: TomlFaaSNamedModuleConfig =
        toml::from_slice(config.as_slice()).map_err(|err| IncorrectModuleConfig { err })?;
    let config = config
        .try_into()
        .map_err(|err| ModuleConvertError { err })?;

    Ok(config)
}
/// Load FaaSModuleConfig from disk, for a given module name
Load FaaSModuleConfig from disk, for a given module name
Load FaaSModuleConfig from disk for a given module name
pub fn load_module_config(
    modules_dir: &PathBuf,
    module: &str,
) -> Result<(String, FaaSModuleConfig)> {
    let config = modules_dir.join(file_names::module_config_name(module));
    let config = std::fs::read(&config).map_err(|err| NoModuleConfig { path: config, err })?;
    let config: TomlFaaSNamedModuleConfig =
        toml::from_slice(config.as_slice()).map_err(|err| IncorrectModuleConfig { err })?;
    let config = config
        .try_into()
        .map_err(|err| ModuleConvertError { err })?;
    Ok(config)
}
pub fn load_module_config ( modules_dir : & PathBuf , module : & str , ) -> Result < ( String , FaaSModuleConfig ) > { let config = modules_dir . join ( file_names :: module_config_name ( module ) ) ; let config = std :: fs :: read ( & config ) . map_err ( | err | NoModuleConfig { path : config , err } ) ? ; let config : TomlFaaSNamedModuleConfig = toml :: from_slice ( config . as_slice ( ) ) . map_err ( | err | IncorrectModuleConfig { err } ) ? ; let config = config . try_into ( ) . map_err ( | err | ModuleConvertError { err } ) ? ; Ok ( config ) }
Load FaaSModuleConfig from disk, for a given module name
Load FaaSModuleConfig from disk for a given module name
modules_dir
&PathBuf
module
&str