Skip to main content

ConfigProvider

Trait ConfigProvider 

Source
pub trait ConfigProvider: Send + Sync {
    // Required methods
    fn get(&self, key: &str) -> Option<String>;
    fn set(&mut self, key: String, value: String);
    fn load_from_file(&self, path: &Path) -> Result<()>;
}
Expand description

Configuration provider trait

Required Methods§

Source

fn get(&self, key: &str) -> Option<String>

Get configuration value by key

Source

fn set(&mut self, key: String, value: String)

Set configuration value

Source

fn load_from_file(&self, path: &Path) -> Result<()>

Load configuration from file

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§