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
//! # rwconfig — Read/Write Config with Dirty Tracking
//!
//! A lightweight config file reader/writer that tracks modifications via `get`/`set`
//! and flushes all changes in one go with `save()`. Like getters/setters with dirty-tracking.
//!
//! ## Features
//!
//! - **Dot-path access** — Use paths like `"server.port"` or `"a.b.c"` for nested values
//! - **Dirty tracking** — Every `set()` marks the config dirty; `save()` writes only when needed
//! - **Multi-format** — JSON, JSON5, JSONC, YAML, TOML; format is inferred from file extension
//!
//! ## Example
//!
//! ```ignore
//! let mut cfg = RWConfig::from_file("config.json")?;
//! let port = cfg.get("server.port").and_then(|v| v.as_i64()).unwrap_or(8080);
//! cfg.set("server.port", json!(9090))?;
//! cfg.save()?;
//! ```
/// Main config struct: load from file, get/set by path, save when dirty.
pub use RWConfig;
/// Unified error type (Io, Parse, Path variants).
pub use Error;
/// Config format enum (Json, Yaml, Toml).
pub use ConfigFormat;
/// Raw path operations on `serde_json::Value`.
pub use ;
/// Re-export for convenience when working with config values.
pub use Value;