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
// SPDX-FileCopyrightText: 2025 Slatian
//
// SPDX-License-Identifier: LGPL-3.0-or-later
//! lib-humus-configuration helps with reading a configuration file into a data structure.
//!
//! It currently supports JSON, JSON5 and TOML.
//!
//! ```rust
//! # #[cfg(feature = "json")]
//! # {
//! use serde::Deserialize;
//! use lib_humus_configuration::read_from_json_file;
//!
//! #[derive(Deserialize)]
//! struct TestData {
//! text: String,
//! n: i64,
//! }
//!
//! let test_data: TestData = read_from_json_file("test-data/test.json").unwrap();
//!
//! assert_eq!(test_data.text, "Foo Bar".to_string());
//! assert_eq!(test_data.n, 123);
//! # }
//! ```
//!
//! This is a companion crate to [lib-humus](https://docs.rs/lib-humus).
//!
//! ## Feature Flags
//!
//! Each format is gated behind its own feature flag, at least one of the has to be enabled.
//!
//! * `json` using the `serde_json` crate.
//! * `json5` using the `json5` crate.
//! * `toml` using the `toml` crate.
//! * `full` enables all supported formats.
//!
pub use ErrorCause;
pub use HumusConfigError;
pub use ConfigFormat;
pub use read_from_file;
pub use Settings;
pub use read_from_json_file;
pub use read_from_json5_file;
pub use read_from_toml_file;
compile_error!;