summaryrefslogtreecommitdiffstats
path: root/src/source.rs
blob: c8a0e83083277e1b4db433072de776ffc3b08631 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use error::*;
use std::fmt::Debug;
use value::Value;
use std::collections::HashMap;

/// Describes a generic _source_ of configuration properties.
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()
    }
}