• Stars
    star
    2,281
  • Rank 19,362 (Top 0.4 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

⚙️ Layered configuration system for Rust applications (with strong support for 12-factor applications).

config-rs

Rust Build Status Crates.io Docs.rs

Layered configuration system for Rust applications (with strong support for 12-factor applications).

  • Set defaults
  • Set explicit values (to programmatically override)
  • Read from JSON, TOML, YAML, INI, RON, JSON5 files
  • Read from environment
  • Loosely typed — Configuration values may be read in any supported type, as long as there exists a reasonable conversion
  • Access nested fields using a formatted path — Uses a subset of JSONPath; currently supports the child ( redis.port ) and subscript operators ( databases[0].name )

Please note this library

  • can not be used to write changed configuration values back to the configuration file(s)!
  • Is case insensitive and all the keys are converted to lowercase internally

Usage

[dependencies]
config = "0.14.0"

Feature flags

  • ini - Adds support for reading INI files
  • json - Adds support for reading JSON files
  • yaml - Adds support for reading YAML files
  • toml - Adds support for reading TOML files
  • ron - Adds support for reading RON files
  • json5 - Adds support for reading JSON5 files

Support for custom formats

Library provides out of the box support for most renowned data formats such as JSON or Yaml. Nonetheless, it contains an extensibility point - a Format trait that, once implemented, allows seamless integration with library's APIs using custom, less popular or proprietary data formats.

See custom_file_format example for more information.

More

See the documentation or examples for more usage information.

MSRV

We currently support Rust 1.75.0 and newer.

License

config-rs is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.

More Repositories

1

awesome-atom

A curated list of delightful Atom packages and resources.
1,896
star
2

rn-splash-screen

A JavaScript-controlled splash-screen for React Native designed to be run directly after the native splash-screen.
Objective-C
351
star
3

shio-rs

Shio is a fast, simple, and asynchronous micro web-framework for Rust.
Rust
279
star
4

guerrilla

☢ Guerrilla (or Monkey) Patching in Rust for (unsafe) fun and profit.
Rust
106
star
5

tokio-diesel

Integrate Diesel into Tokio cleanly and efficiently.
Rust
105
star
6

schedule-rs

An in-process scheduler for periodic jobs. Schedule lets you run Rust functions on a cron-like schedule.
Rust
103
star
7

atom-project-plus

Simply awesome project management in Atom.
JavaScript
98
star
8

actix-diesel

Integrate Diesel into Actix (and Actix Web) cleanly and efficiently.
Rust
85
star
9

atom-minimap-plus

JavaScript
82
star
10

python-xmlsec

Python bindings for the XML Security Library.
C
75
star
11

actix-web-async-await

Provides a preview of Actix with async/await support.
Rust
56
star
12

python-saml

A python interface to produce and consume Security Assertion Markup Language (SAML) v2.0 messages.
Python
28
star
13

rn-ios-user-agent

Set (and unset) a UserAgent to be used in WebView.
Objective-C
26
star
14

wadatsumi

🎮 Accuracy-focused GBA/CGB/SGB/GMB emulator in Rust.
Rust
25
star
15

arc

Native UI toolkit for creating (eventually) cross-platform (macOS only currently) graphical user interfaces in Rust.
Rust
23
star
16

async-diesel

Integrate Diesel into async-std cleanly and efficiently.
Rust
18
star
17

webpack-config-plugin

Configuration plugin (in the style of node-config) for webpack.
JavaScript
14
star
18

linter-ui-plus

An experiment into an enhanced UI for the Atom Linter package.
JavaScript
12
star
19

atom-updater

Automatic updates (on Linux) for the Atom text editor
JavaScript
12
star
20

rn-razor

Router for React Native with declarative configuration similar to React Router.
JavaScript
12
star
21

oauth1-rs

Rust
11
star
22

init-rs

Mark a function to run before main.
Rust
9
star
23

atomic-array-rs

Defines several array types in which elements may be updated atomically. Intended to provide atomic array types similar to those found in java.util.concurrent.atomic in Java.
Rust
8
star
24

rockman

A simple AUR helper written in Rust.
Rust
8
star
25

xchip

Accurate CHIP-8, CHIP-10, HIRES CHIP-8, CHIP-8X, SUPER-CHIP, and XO-CHIP interpreter in Rust.
Rust
8
star
26

rn-notification

React Native Cross-Platform Remote and Local Notifications
Java
6
star
27

pumpkin.js

Beautiful and reactive form component using Alt and React (at least until midnight).
JavaScript
6
star
28

country-telephone-code

Simple getter for telephone codes for all countries (backed by a script that dumps data direct from the CLDR).
JavaScript
5
star
29

busybox

Rust
4
star
30

rn-viewport

JavaScript
4
star
31

atom-project-util

JavaScript
4
star
32

rn-device-activity

Device Activity Events for React Native (iOS and Android)
Java
4
star
33

country-name

Simple getter for country names in all languages (backed by a script that dumps data direct from the CLDR).
JavaScript
3
star
34

atom-symbols-plus

JavaScript
3
star
35

go-develop

Wrapper for `go get` to setup a project for development.
Go
3
star
36

emailx-rs

Robust email syntax and deliverability validation.
Rust
3
star
37

axal

Framework to greatly simply emulation core development. Provides methods to auto-generate bindings for libretro in addition to a stand-alone UI.
C++
2
star
38

lintel-nes

Rust
2
star
39

bugsnag-rs

Bugsnag error monitoring for rust
Rust
2
star
40

webpack-vendor-plugin

Vendor plugin (separate out vendor files into a separate chunk) for webpack.
JavaScript
2
star
41

docker-atlassian-crowd

Shell
1
star
42

node-short-stack

Elegant and delicious stack traces for node.
JavaScript
1
star
43

rn-braintree

React Native interface to Braintree's Android and iOS SDKs
Java
1
star
44

polyfill-viewport-units

A complete polyfill for viewport units.
JavaScript
1
star
45

cargo-outdated-bug-patch

Rust
1
star
46

language-name

JavaScript
1
star
47

atomic-ref2-rs

Provides AtomicOptionRef and AtomicRef. Intended to map to java.util.concurrent.atomic.AtomicReference in Java.
Rust
1
star