diff --git a/libimagrt/src/configuration.rs b/libimagrt/src/configuration.rs index 6b4319f1..53e2f659 100644 --- a/libimagrt/src/configuration.rs +++ b/libimagrt/src/configuration.rs @@ -1,5 +1,6 @@ use std::path::PathBuf; use std::result::Result as RResult; +use std::ops::Deref; use toml::{Parser, Value}; @@ -169,6 +170,15 @@ impl Configuration { } +impl Deref for Configuration { + type Target = Value; + + fn deref(&self) -> &Value { + &self.config + } + +} + fn get_verbosity(v: &Value) -> bool { match v { &Value::Table(ref t) => t.get("verbose") diff --git a/libimagrt/src/runtime.rs b/libimagrt/src/runtime.rs index ecc5c227..3ff43d76 100644 --- a/libimagrt/src/runtime.rs +++ b/libimagrt/src/runtime.rs @@ -238,6 +238,13 @@ impl<'a> Runtime<'a> { &self.cli_matches } + /** + * Get the configuration object + */ + pub fn config(&self) -> Option<&Configuration> { + self.configuration.as_ref() + } + /** * Get the store object */