ch-config 0.1.0

Typed configuration loading with validation and secret-file support
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![doc = include_str!("../README.md")]
#![forbid(unsafe_code)]
#![warn(missing_docs, rustdoc::broken_intra_doc_links)]

pub mod config;
pub mod environment;

use std::sync::Arc;

pub use config::{AppConfig, ConfigError, EnvironmentFileError, Result};

/// Applies deployment environment values to stable defaults, validates the
/// result, and shares the resolved configuration.
pub fn load_app_config(defaults: AppConfig) -> Result<Arc<AppConfig>> {
    AppConfig::from_env(defaults).map(Arc::new)
}