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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! Settings primitives shared by Footing components.
//!
//! This module owns component-level deserialization and invariant validation.
//! Application-level loading, source precedence, metadata, and documentation
//! belong to a configuration framework such as Tier.
//!
//! Component settings expose `validate_at(path)` when their validation produces
//! field paths. Use the component's actual location in the application settings,
//! such as `"database.pool"`; an empty path validates it at the document root.
//! `validate()` uses the component's documented default location instead.
//!
//! ```rust
//! # #[cfg(feature = "postgres")]
//! # {
//! use footing::db::postgres::PostgresPoolSettings;
//!
//! let pool = PostgresPoolSettings::default().with_max_connections(0);
//! let error = pool.validate_at("pool").unwrap_err();
//! assert_eq!(error.issues()[0].path(), "pool.max_connections");
//! let error = pool.validate_at("").unwrap_err();
//! assert_eq!(error.issues()[0].path(), "max_connections");
//! # }
//! ```
//!
//! ```rust
//! use std::time::Duration;
//!
//! use footing::settings::human_duration;
//!
//! let timeout = human_duration::parse("1m30s").unwrap();
//! assert_eq!(timeout, Duration::from_secs(90));
//! ```
pub use ;
pub