Realme
Realme is a flexible and extensible configuration management library for Rust. It simplifies the process of loading and managing configuration settings from various sources. The name "Realme" is a play on "Realm" and "me," emphasizing its role in managing your application's configuration realm.
Features
- Support for multiple configuration formats (TOML, JSON, YAML, JSON5, RON, INI), and you can easily add support for more formats
- Loosely typed — Serialization and deserialization of configuration data, configuration values may be read in any supported type, as long as there exists a reasonable conversion
- Custom parser support and flexible adaptor system for different data sources, for example, you can read configuration from a file, environment variables, command line flags, etc.
- Live watching and re-reading of config files
Installation
Add this to your Cargo.toml:
[]
= { = "0.1.4", = ["toml"]}
You can also enable other features, for example, to use hot reloading feature, you need to enable json andhot_reload feature:
= { = "0.1.4", = ["toml", "json", "hot_reload"]}
Usage
Here's a simple example of how to use Realme:
use ;
use ;
const CONFIGURATION1: &str = r#"
name = "John"
age = 30
birthday = 1993-01-01T00:00:00Z
"#;
For more detailed examples, check the examples directory.
For a real-world example, you can check the Rinkle project.
License
This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Copyright
Copyright 2024 Jasper Zhang