Trait configure::source::ConfigSource [−][src]
pub trait ConfigSource: Send + Sync + 'static { fn init() -> Self; fn prepare(
&self,
package: &'static str
) -> Box<DynamicDeserializer<'static>>; }
A source for configuration.
If an end user wishes to pull configuration from the environment, they must
specify their source, which is a type that implements ConfigSource. The
source can be specified using the use_config_from!
macro.
This crate ships a default source, called DefaultSource, which implements this trait.
Required Methods
fn init() -> Self
Initialize this source. This will be called once when the program begins and then never called again.
ⓘImportant traits for Box<R>
fn prepare(&self, package: &'static str) -> Box<DynamicDeserializer<'static>>
Prepare a deserializer for a particular package. This will be called every time we generate configuration for that package.
Implementors
impl ConfigSource for DefaultSource