Skip to main content

ConfigReader

Trait ConfigReader 

Source
pub trait ConfigReader<T>: ConfigLoader<T>{
    // Provided methods
    fn get_config_file_path(expanded_path: &Path) -> PathBuf { ... }
    fn write_default_config_file(config_file_path: &PathBuf) -> Result<()> { ... }
    fn read_config_file<'async_trait>(
        expanded_path: PathBuf,
    ) -> Pin<Box<dyn Future<Output = Result<T, DynError>> + Send + 'async_trait>>
       where Self: Send + 'async_trait { ... }
}

Provided Methods§

Source

fn get_config_file_path(expanded_path: &Path) -> PathBuf

Returns the config file path in this directory

Source

fn write_default_config_file(config_file_path: &PathBuf) -> Result<()>

Source

fn read_config_file<'async_trait>( expanded_path: PathBuf, ) -> Pin<Box<dyn Future<Output = Result<T, DynError>> + Send + 'async_trait>>
where Self: Send + 'async_trait,

Given a directory path, ensures the directory exists, writes a default config.toml if absent, then parses and returns the loaded config

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> ConfigReader<T> for T