https://github.com/zakarumych/denvars
Deserialize environment variables with serde
https://github.com/zakarumych/denvars
Last synced: about 1 month ago
JSON representation
Deserialize environment variables with serde
- Host: GitHub
- URL: https://github.com/zakarumych/denvars
- Owner: zakarumych
- Created: 2023-09-27T15:30:58.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-03T09:37:10.000Z (about 2 years ago)
- Last Synced: 2025-02-17T03:57:11.641Z (8 months ago)
- Language: Rust
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Denvars - Deserialize environment variables
This crate provides deserializer that reads from environment variables or user-provided array of key-value pairs.
For convenience, it can be configured to call specific visiting method for different kind of data.
By default it parses booleans from large set of possible values,\
numbers using `FromStr`,\
sequences from comma-separated values,\
maps from comma-separated key:value pairs,\
allows using potentially escaped strings in double quotes,\
decodes base64-encoded byte arrays if configured (this is default behavior),\
compare uppercased names of fields when deserializing struct from map of env vars if configured (this is default behavior),\
It may treat values as JSON to support deserializing nested structures.\
Custom string parsers may be implemented to support other formats.## License
Licensed under either of
* Apache License, Version 2.0, ([license/APACHE](license/APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([license/MIT](license/MIT) or http://opensource.org/licenses/MIT)at your option.
## Contributions
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.