| Crates.io | config-more-formats |
| lib.rs | config-more-formats |
| version | 1.1.1 |
| created_at | 2024-09-15 06:06:47.952611+00 |
| updated_at | 2024-09-23 17:15:51.288644+00 |
| description | Additional formats for the config library. |
| homepage | |
| repository | https://github.com/z0ne-dev/config-more-formats |
| max_upload_size | |
| id | 1375271 |
| size | 49,322 |
Add more formats to config.
This crate provides additional formats for figment. If you need additional formats, you can include this crate and use the provided formats.
Additionally, this adds a function to parse a file by its extension.
Supported formats added by this crate:
| Format | Feature | Crate | Description |
|---|---|---|---|
| YAML-NG | yaml_ng |
serde-yaml-ng | An actively maintained fork of serde_yaml |
| JAVA Properties | properties |
serde-java-properties | Java properties file format |
| HJSON | hjson |
serde-hjson | Human JSON |
| HCL | hcl |
hcl-rs | HashiCorp Configuration Language |
| Ason | ason |
ason | Ason format |
| JSON | json |
serde_json | config supplied JSON format |
| JSON5 | json5 |
serde-json5 | config supplied JSON5 format |
| RON | ron |
ron | config supplied RON format |
| TOML | toml |
toml | config supplied TOML format |
| YAML | yaml |
yaml-rust | config supplied YAML format (using deprecated serde_yaml) |
| INI | ini |
ini | config supplied INI format |
all |
Enable all formats except for yaml |
If you do not enable yaml, yaml_ng will be used for yaml files instead.
Instead of all, enable only the formats you need to reduce compile times and dependencies.
The current development version of config already uses yaml-rust2
which is a fork of yaml-rust and is actively maintained.
This crate uses serde_yaml_ng which is another actively maintained solution for YAML.
by_file_extension]use config::Config;use config_more_formats::by_file_extension;
let settings = Config::builder()
.add_source(by_file_extension("settings.toml").unwrap())
.build()
.unwrap();
Licensed under
at your option.