summaryrefslogtreecommitdiffstats
path: root/src/source.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/source.rs')
-rw-r--r--src/source.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/source.rs b/src/source.rs
index 5db362e..c8a0e83 100644
--- a/src/source.rs
+++ b/src/source.rs
@@ -1,10 +1,19 @@
use error::*;
+use std::fmt::Debug;
use value::Value;
use std::collections::HashMap;
/// Describes a generic _source_ of configuration properties.
-pub trait Source {
+pub trait Source: Debug {
+ fn clone_into_box(&self) -> Box<Source + Send + Sync>;
+
/// Collect all configuration properties available from this source and return
/// a HashMap.
fn collect(&self) -> Result<HashMap<String, Value>>;
}
+
+impl Clone for Box<Source + Send + Sync> {
+ fn clone(&self) -> Box<Source + Send + Sync> {
+ self.clone_into_box()
+ }
+}