# Trait config::Source

source · [−]

    pub trait Source: Debug {
        fn clone_into_box(&self) -> Box<dyn Source + Send + Sync>;
        fn collect(&self) -> Result<Map<String, Value>, ConfigError>;

        fn collect_to(&self, cache: &mut Value) -> Result<(), ConfigError> { ... }
    }

Expand description

Describes a generic source of configuration properties.

## Required Methods

source

#### fn clone_into_box(&self) -> Box<dyn Source + Send + Sync>

source

#### fn collect(&self) -> Result<Map<String, Value>, ConfigError>

Collect all configuration properties available from this source and return a Map.

## Provided Methods

source

#### fn collect_to(&self, cache: &mut Value) -> Result<(), ConfigError>

Collects all configuration properties to a provided cache.

## Trait Implementations

source

### impl Clone for Box<dyn Source + Send + Sync>

source

#### fn clone(&self) -> Self

Returns a copy of the value. Read more

1.0.0 · source

#### fn clone_from(&mut self, source: &Self)

Performs copy-assignment from `source`. Read more

## Implementations on Foreign Types

source

### impl Source for Vec<Box<dyn Source + Send + Sync>>

source

#### fn clone_into_box(&self) -> Box<dyn Source + Send + Sync>

source

#### fn collect(&self) -> Result<Map<String, Value>, ConfigError>

source

### impl Source for [Box<dyn Source + Send + Sync>]

source

#### fn clone_into_box(&self) -> Box<dyn Source + Send + Sync>

source

#### fn collect(&self) -> Result<Map<String, Value>, ConfigError>

source

### impl<T> Source for Vec<T> where
T: Source + Sync + Send + Clone + 'static,

source

#### fn clone_into_box(&self) -> Box<dyn Source + Send + Sync>

source

#### fn collect(&self) -> Result<Map<String, Value>, ConfigError>

## Implementors

source

### impl Source for Config

source

### impl Source for Environment

source

### impl<T, F> Source for File<T, F> where
F: FileStoredFormat + Debug + Clone + Send + Sync + 'static,
T: Sync + Send + FileSource<F> + 'static,