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
41
//! # modo::config
//!
//! YAML configuration loader with environment-variable substitution.
//!
//! Config files live in a directory (e.g. `config/`) and are named after the
//! active environment: `development.yaml`, `production.yaml`, `test.yaml`.
//! The active environment is read from the `APP_ENV` environment variable;
//! it defaults to `"development"` when unset.
//!
//! Before deserialization, `${VAR}` placeholders are replaced with values from
//! the process environment. Use `${VAR:default}` to supply a fallback when
//! `VAR` is not set.
//!
//! Provides:
//! - [`Config`] — top-level framework configuration struct composing the
//! sub-config of every built-in module.
//! - [`load`] — reads `{dir}/{APP_ENV}.yaml`, substitutes env vars, and
//! deserializes into `T`.
//! - [`env`] — returns the current `APP_ENV` value (default: `"development"`).
//! - [`is_dev`], [`is_prod`], [`is_test`] — environment predicates.
//! - [`substitute`] — submodule exposing [`substitute::substitute_env_vars`] for
//! replacing `${VAR}` placeholders in arbitrary strings.
//!
//! ## Quick start
//!
//! ```no_run
//! use modo::config::load;
//! use modo::Config;
//!
//! // Reads config/development.yaml (or whatever APP_ENV resolves to)
//! let config: Config = load("config/").unwrap();
//! ```
pub use ;
pub use load;
pub use Config;