mirror of
https://github.com/OMGeeky/confique.git
synced 2026-02-23 15:38:30 +01:00
Improve documentation
This commit is contained in:
@@ -5,7 +5,8 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
## [Unreleased]
|
||||
### Added
|
||||
- `parse_env` attribute which is using for parse env variable in arbitrary type
|
||||
- `parse_env` attribute for custom parsing of environment variables (allows you
|
||||
to load lists and other complex objects from env vars).
|
||||
|
||||
## [0.2.0] - 2022-10-21
|
||||
### Added
|
||||
|
||||
11
src/lib.rs
11
src/lib.rs
@@ -320,11 +320,14 @@ pub use crate::{
|
||||
/// - **`#[config(deserialize_with = path::to::function)]`**: like
|
||||
/// [serde's `deserialize_with` attribute][serde-deser].
|
||||
///
|
||||
/// [serde-deser]: https://serde.rs/field-attrs.html#deserialize_with
|
||||
/// - **`#[config(parse_env = path::to::function)]`**: function used to parse
|
||||
/// environment variables. Mostly useful if you need to parse lists or
|
||||
/// other complex objects from env vars. Function needs signature
|
||||
/// `fn(&str) -> Result<T, impl std::error::Error>` where `T` is the type of
|
||||
/// the field.. Can only be present if the `env` attribute is present. Also
|
||||
/// see [`env::parse`].
|
||||
///
|
||||
/// - **`#[config(from_env = path::to::function, env = "KEY")]`**: like
|
||||
/// deserialize_with` attribute, but only for fields from an environment variable.
|
||||
/// Can only be present if the `env` attribute is present
|
||||
/// [serde-deser]: https://serde.rs/field-attrs.html#deserialize_with
|
||||
///
|
||||
/// ## Special types for leaf fields
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user