1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Layered configuration: pluggable sources, priority merging, typed access.
//!
//! ```rust,no_run
//! # async fn _example() -> Result<(), Box<dyn std::error::Error>> {
//! use stratify::config;
//!
//! let store = config::Builder::default()
//! .json("config/base.json", 100)
//! .yaml("config/override.yaml", 50)
//! .env("APP_", "__", 10)
//! .build()
//! .await?;
//!
//! let host = store.get_str("database.host");
//! # Ok(()) }
//! ```
//!
//! # Precedence
//!
//! **Lower priority number wins.** A source at priority 10 overrides one at
//! 100. That is the opposite of treating the number as a weight, and it is
//! deliberate: it lets a more specific source be added later without
//! renumbering the ones already there.
//!
//! Merging is deep. Nested objects combine key by key rather than the
//! higher-precedence source replacing a whole subtree.
/// Fluent builder for assembling sources into a [`Store`].
/// Error type returned by loading and lookup.
/// Built-in configuration sources and the [`Source`] trait.
/// The merged, cached configuration store.
pub use Builder;
pub use Error;
pub use Source;
pub use Store;