summaryrefslogtreecommitdiffstats
path: root/src/source.rs
diff options
context:
space:
mode:
authorRyan Leckey <leckey.ryan@gmail.com>2017-01-26 19:02:13 -0800
committerRyan Leckey <leckey.ryan@gmail.com>2017-01-26 19:02:13 -0800
commit589036c19409c7626a5bafda5af96c2fbc6a7de5 (patch)
tree9f4e09809df7c200c3d60b619c7eea9b91e6d70c /src/source.rs
parentd7ad51c8851fe3c845569760935fae1828e859b5 (diff)
Refactor the file source to allow for N formats; implement JSON.
Diffstat (limited to 'src/source.rs')
-rw-r--r--src/source.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/source.rs b/src/source.rs
index 95785a6..1a8d08f 100644
--- a/src/source.rs
+++ b/src/source.rs
@@ -1,8 +1,11 @@
use std::error::Error;
-use std::collections::HashMap;
use value::Value;
pub trait Source {
- fn build(&mut self) -> Result<HashMap<String, Value>, Box<Error>>;
+ fn get(&self, key: &str) -> Option<Value>;
+}
+
+pub trait SourceBuilder {
+ fn build(&self) -> Result<Box<Source>, Box<Error>>;
}