Skip to main content

ModuleConfig

Trait ModuleConfig 

Source
pub trait ModuleConfig: Default {
    // Required methods
    fn load_config(path: impl AsRef<Path>) -> Result<Self, Error>
       where Self: Sized;
    fn config_map(&self) -> HashMap<String, String>;
}
Expand description

Config types that can be loaded and converted to context map. Use impl_module_config!(ConfigType) to implement by delegating to inherent load and to_context_map.

Required Methods§

Source

fn load_config(path: impl AsRef<Path>) -> Result<Self, Error>
where Self: Sized,

Source

fn config_map(&self) -> HashMap<String, String>

Return config as key-value map for ModuleContext. Delegates to inherent to_context_map via macro.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§