File: README.md

package info (click to toggle)
rust-config-file 0.2.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 140 kB
  • sloc: xml: 9; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 660 bytes parent folder | download | duplicates (2)
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
# config-file

[![API Docs](https://docs.rs/config-file/badge.svg)](https://docs.rs/config-file)
[![Downloads](https://img.shields.io/crates/d/config-file.svg)](https://crates.io/crates/config-file)

## Read and parse configuration file automatically

config-file reads your configuration files and parse them automatically using their extension.

## Features

- toml is enabled by default
- json is optional
- xml is optional
- yaml is optional

## Examples

```rust
use config_file::FromConfigFile;
use serde::Deserialize;

#[derive(Deserialize)]
struct Config {
    host: String,
}

let config = Config::from_config_file("/etc/myconfig.toml").unwrap();
```