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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//! # config-get
//!
//! Cross-platform configuration file locator and reader for Rust.
//!
//! `config-get` automatically discovers and reads configuration files from
//! standard OS-specific locations, supporting `.env`, `.ini`, `.toml`, `.json`,
//! `.yml`, and `.yaml` formats — no manual path wrangling required.
//!
//! ## Quick start
//!
//! ```rust
//! # use config_get::ConfigGet;
//! # fn main() -> config_get::Result<()> {
//! # /*
//! let cfg = ConfigGet::builder("myapp")
//! .config_dir("myapp")
//! .build()?;
//!
//! let host = cfg.get("DB_HOST").unwrap_or("localhost");
//! let port: u16 = cfg.parse("DB_PORT")?;
//! let debug = cfg.get_in_or("server", "debug", "false");
//! # */
//! # Ok(())
//! # }
//! ```
//!
//! ## Features
//!
//! | Feature | Enables | Default |
//! |---------|---------|---------|
//! | `dotenv` | `.env` via `dotenvy` | ✓ |
//! | `ini` | `.ini` via `rust-ini` | ✓ |
//! | `toml` | `.toml` via `toml` | ✓ |
//! | `yaml` | `.yaml`/`.yml` via `serde_yaml` | ✓ |
//! | `cli` | `config-get` binary via `clap` | ✗ |
//! | `all` | All of the above | ✗ |
/// Core [`ConfigGet`] type and its builder.
/// Platform-aware directory search logic.
/// Error types for this crate.
/// Supported file format detection.
/// Format-specific parsers.
/// Internal key/value storage.
// Top-level re-exports for ergonomic use.
pub use ConfigGet;
pub use ConfigGetBuilder;
pub use ;
pub use Format;
pub use ConfigMap;
/// Convenience function — returns the path of the first matching config file,
/// or `None`.
///
/// ```rust
/// use config_get::get_config_file;
/// let path = get_config_file("myapp", "myapp");
/// // path.is_some() if a config file was found
/// ```