diff options
author | Ryan Leckey <ryan@launchbadge.com> | 2017-06-22 14:14:29 -0700 |
---|---|---|
committer | Ryan Leckey <ryan@launchbadge.com> | 2017-06-22 14:30:51 -0700 |
commit | 2b438ed9b53fee5689032f3b5fcdda8d15becd5f (patch) | |
tree | 48374e66a6594c7d11d19fe38f7e23df731b52be /src/source.rs | |
parent | 04d3ee8f70337e4899932b92262fbeec2dbb1bd9 (diff) |
Add builder API to Config
Diffstat (limited to 'src/source.rs')
-rw-r--r-- | src/source.rs | 11 |
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() + } +} |