Trait configure::source::ConfigSource

source ·
pub trait ConfigSource: Send + Sync + 'static {
    // Required methods
    fn init() -> Self;
    fn prepare(
        &self,
        package: &'static str
    ) -> Box<dyn DynamicDeserializer<'static>>;
}
Expand description

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§

source

fn init() -> Self

Initialize this source. This will be called once when the program begins and then never called again.

source

fn prepare( &self, package: &'static str ) -> Box<dyn DynamicDeserializer<'static>>

Prepare a deserializer for a particular package. This will be called every time we generate configuration for that package.

Object Safety§

This trait is not object safe.

Implementors§