pub trait Configurable {
// Required method
fn config(&self) -> &Value;
// Provided methods
fn load_config(
config_file_path: impl AsRef<Path>,
) -> Result<Value, ConfigError> { ... }
fn load_text_file_lines(
file_path: impl AsRef<Path>,
) -> Result<Vec<String>, ConfigError> { ... }
fn get_config_value(&self, key: &str) -> Option<&Value> { ... }
fn get_value_recursive<'a>(
config: &'a Value,
keys: &[&str],
) -> Option<&'a Value> { ... }
}Required Methods§
Provided Methods§
fn load_config(config_file_path: impl AsRef<Path>) -> Result<Value, ConfigError>
Sourcefn load_text_file_lines(
file_path: impl AsRef<Path>,
) -> Result<Vec<String>, ConfigError>
fn load_text_file_lines( file_path: impl AsRef<Path>, ) -> Result<Vec<String>, ConfigError>
Load Vec<String>`` from file with path file path`
Sourcefn get_config_value(&self, key: &str) -> Option<&Value>
fn get_config_value(&self, key: &str) -> Option<&Value>
Extract Value from config using dot notation i.e. “app.concurrency”
fn get_value_recursive<'a>( config: &'a Value, keys: &[&str], ) -> Option<&'a Value>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".